Tensor
Ndonnx-backed tensor that ducktypes as torch.Tensor.
Tensor objects may also be used in the torch functions listed here.
Methods:
-
argmax–See torch.Tensor.argmax for details.
-
argmin–See torch.Tensor.argmin for details.
-
chunk–See torch.Tensor.chunk for details.
-
contiguous–See torch.Tensor.contiguous for details.
-
dim–See torch.Tensor.dim for details.
-
expand–See torch.Tensor.expand for details.
-
masked_fill–See torch.Tensor.masked_fill for details.
-
mean–See torch.Tensor.mean for details.
-
ndim–Return the rank of this tensor.
-
size–The size of the tensor.
-
to–See torch.Tensor.to for details.
-
to_ndonnx–Return the inner ndonnx array.
-
transpose–See torch.Tensor.transpose for details.
-
unwrap_numpy–Return the result of constant value propagation or raise a
ValueError. -
view–See torch.Tensor.view for details.
Attributes:
-
device(None) –The device on which the data is allocated.
-
dtype(dtype) –See `torch.Tensor.dtype for details.
-
shape(int | Tensor | tuple[int | Tensor, ...]) –The shape of the tensor.
device
property
device: None
The device on which the data is allocated.
This is always None since the concept does not apply to ONNX export
shape
property
The shape of the tensor.
Contrary to pytorch.Tensor.shape, this function may return
Tensor objects for dimensions with a dynamic length.
argmax
See torch.Tensor.argmax for details.
argmin
See torch.Tensor.argmin for details.
contiguous
contiguous(memory_format=contiguous_format) -> Tensor
See torch.Tensor.contiguous for details.
mean
mean(
dim: int | tuple[int, ...] | None = None,
keepdim: bool = False,
*,
dtype: dtype | None = None,
) -> Tensor
See torch.Tensor.mean for details.
ndim
ndim() -> int
Return the rank of this tensor.
size
The size of the tensor.
Contrary to pytorch.Tensor.size, this function may return
Tensor objects for dimensions with a dynamic length.
unwrap_numpy
unwrap_numpy() -> ndarray
Return the result of constant value propagation or raise a ValueError.
This function is primarily useful for debugging and testing. It only returns a value if the value does not depend on any graph inputs. However, if that is the case in production code, such a value should be stored as a NumPy array or pytorch Tensor in the first place.