Class TensorFormat¶
Defined in File torch_tensorrt.h
Class Documentation¶
-
class 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.
-
enumerator kContiguous¶
Public Functions
-
TensorFormat() = default¶
Construct a new TensorFormat object.
-
inline constexpr TensorFormat(Value t)¶
TensorFormat constructor from enum.
-
TORCHTRT_API TensorFormat(at::MemoryFormat t)¶
Construct a new TensorFormat object from torch type enums.
- Parameters
t –
-
inline operator Value() const¶
Get the enum value of the TensorFormat object.
- Returns
Value
-
explicit operator bool() = delete¶
-
inline constexpr bool operator==(TensorFormat other) const¶
Comparision operator for TensorFormat.
- Parameters
other –
- Returns
true
false
-
inline constexpr bool operator==(TensorFormat::Value other) const¶
Comparision operator for TensorFormat.
- Parameters
other –
- Returns
true
false
-
inline constexpr bool operator!=(TensorFormat other) const¶
Comparision operator for TensorFormat.
- Parameters
other –
- Returns
true
false
-
inline constexpr bool operator!=(TensorFormat::Value other) const¶
Comparision operator for TensorFormat.
- Parameters
other –
- Returns
true
false
-
enum Value¶