public static Tensor NewFromDTO(TensorDTO dto) { var result = new Tensor(dto.ShapeX, dto.ShapeY); result.CopyFrom(dto.Buffer); return(result); }
public bool IsSame(TensorDTO rhs) { if (ShapeX != rhs.ShapeX) { return(false); } if (ShapeY != rhs.ShapeY) { return(false); } for (var i = 0; i < Buffer.Length; i++) { if (Buffer[i] != rhs.Buffer[i]) { return(false); } } return(true); }