MemoryFormat

torch.MemoryFormat

A memoryFormat is an object representing the memory format on which a torch.Tensor is or will be allocated.

Attributes

Source
MemoryFormat.scala
Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

case case ChannelsLast extends MemoryFormat

Tensor is or will be allocated in dense non-overlapping memory. Strides represented by values in strides[0] > strides[2] > strides[3] > strides[1] == 1 aka NHWC order.

Tensor is or will be allocated in dense non-overlapping memory. Strides represented by values in strides[0] > strides[2] > strides[3] > strides[1] == 1 aka NHWC order.

Attributes

Source
MemoryFormat.scala
case case ChannelsLast3d extends MemoryFormat

Attributes

Source
MemoryFormat.scala
case case Contiguous extends MemoryFormat

Tensor is or will be allocated in dense non-overlapping memory. Strides represented by values in decreasing order.

Tensor is or will be allocated in dense non-overlapping memory. Strides represented by values in decreasing order.

Attributes

Source
MemoryFormat.scala
case case Preserve extends MemoryFormat

Used in functions like clone to preserve the memory format of the input tensor. If input tensor is allocated in dense non-overlapping memory, the output tensor strides will be copied from the input. Otherwise output strides will follow torch.contiguous_format

Used in functions like clone to preserve the memory format of the input tensor. If input tensor is allocated in dense non-overlapping memory, the output tensor strides will be copied from the input. Otherwise output strides will follow torch.contiguous_format

Attributes

Source
MemoryFormat.scala