Class TensorFormat

Class Documentation

class torch_tensorrt :: TensorFormat

TensorFormat is an enum class which defines the memeory layout used to store Tensor Data.

Public Types

enum Value

Underlying enum class to support the TensorFormat Class

In the case that you need to use the TensorFormat class itself, interface using this enum vs. normal instatination

ex. torch_tensorrt::TensorFormat type = TensorFormat::kContiguous ;

Values:

enumerator kContiguous

Contiguous / NCHW / Linear.

enumerator kChannelsLast

Channel Last / NHWC.

enumerator kUnknown

Sentinel value.

Public Functions

TensorFormat ( ) = default

Construct a new TensorFormat object.

constexpr TensorFormat ( Value t )

TensorFormat constructor from enum.

TensorFormat ( at::MemoryFormat t )

Construct a new TensorFormat object from torch type enums.

Parameters
  • t :

operator Value ( ) const

Get the enum value of the TensorFormat object.

Return

Value

operator bool ( ) = delete
constexpr bool operator== ( TensorFormat other ) const

Comparision operator for TensorFormat .

Return

true

Return

false

Parameters
  • other :

constexpr bool operator== ( TensorFormat :: Value other ) const

Comparision operator for TensorFormat .

Return

true

Return

false

Parameters
  • other :

constexpr bool operator!= ( TensorFormat other ) const

Comparision operator for TensorFormat .

Return

true

Return

false

Parameters
  • other :

constexpr bool operator!= ( TensorFormat :: Value other ) const

Comparision operator for TensorFormat .

Return

true

Return

false

Parameters
  • other :