ExTorch.Tensor (extorch v0.1.0-pre0)
An ExTorch.Tensor
is a multi-dimensional matrix containing elements of a single data type.
Link to this section Summary
Types
An ExTorch.Tensor
is a multi-dimensional matrix containing elements of a single data type.
Tensor information
Get the device of a tensor.
Get the dtype of a tensor.
Get a human readable representation of a tensor.
Get the size of a tensor.
Convert a tensor into a list.
Functions
Index a tensor using an accessor object. It acts as a alias for ExTorch.index/2
.
Link to this section Types
@type t() :: %ExTorch.Tensor{ device: ExTorch.Device.device(), dtype: ExTorch.DType.dtype(), reference: reference(), resource: any(), size: tuple() }
An ExTorch.Tensor
is a multi-dimensional matrix containing elements of a single data type.
Link to this section Tensor information
device(tensor)
@spec device(t()) :: ExTorch.Device.device()
Get the device of a tensor.
arguments
Arguments
- tensor (
ExTorch.Tensor
): Input tensor
dtype(tensor)
@spec dtype(t()) :: ExTorch.DType.dtype()
Get the dtype of a tensor.
arguments
Arguments
- tensor (
ExTorch.Tensor
): Input tensor
repr(tensor)
Get a human readable representation of a tensor.
arguments
Arguments
- tensor (
ExTorch.Tensor
): Input tensor
size(tensor)
Get the size of a tensor.
arguments
Arguments
tensor
: Input tensor
to_list(tensor)
Convert a tensor into a list.
arguments
Arguments
- tensor (
ExTorch.Tensor
): Input tensor
Link to this section Functions
fetch(tensor, index)
@spec fetch(t(), ExTorch.Index.t()) :: {:ok, t()}
Index a tensor using an accessor object. It acts as a alias for ExTorch.index/2
.