Skip to content

tinker.types.TensorData

class tinker.types.TensorData(StrictBase)

Fields:

  • data – Flattened tensor data as array of numbers.
  • dtype
  • shape – Optional.

    The shape of the tensor (see PyTorch tensor.shape). The shape of a one-dimensional list of length N is (N,). Can usually be inferred if not provided, and is generally inferred as a 1D tensor.

to_numpy()

Convert TensorData to numpy array.

Returns: npt.NDArray[Any]

to_torch()

Convert TensorData to torch tensor.

Returns: 'torch.Tensor'