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

t()

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

@spec device(t()) :: ExTorch.Device.device()

Get the device of a tensor.

arguments

Arguments

@spec dtype(t()) :: ExTorch.DType.dtype()

Get the dtype of a tensor.

arguments

Arguments

@spec repr(t()) :: binary()

Get a human readable representation of a tensor.

arguments

Arguments

@spec size(t()) :: tuple()

Get the size of a tensor.

arguments

Arguments

  • tensor: Input tensor
Link to this function

to_list(tensor)

@spec to_list(t()) :: list()

Convert a tensor into a list.

arguments

Arguments

Link to this section Functions

Link to this function

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.