TensorFormat 类¶
类文档¶
-
class TensorFormat¶
TensorFormat 是一个枚举类,它定义了用于存储张量数据内存布局。
公共类型
-
enum Value¶
支持 TensorFormat 类底层枚举类
如果您需要使用 TensorFormat 类本身,请使用此枚举而不是正常实例化进行接口
例如 torch_tensorrt::TensorFormat 类型 = TensorFormat::kContiguous;
值
-
enumerator kContiguous¶
连续 / NCHW / 线性。
-
enumerator kChannelsLast¶
通道在后 / NHWC。
-
enumerator kUnknown¶
哨兵值。
-
enumerator kContiguous¶
公共函数
-
TensorFormat() = default¶
构造一个新的 TensorFormat 对象。
-
inline constexpr TensorFormat(Value t)¶
从枚举构造 TensorFormat。
-
TORCHTRT_API TensorFormat(at::MemoryFormat t)¶
从 torch 类型枚举构造新的 TensorFormat 对象。
- 参数
t –
-
inline constexpr operator Value() const¶
获取 TensorFormat 对象的枚举值。
- 返回
值
-
explicit operator bool() = delete¶
-
inline constexpr bool operator==(TensorFormat other) const¶
TensorFormat 的比较运算符。
- 参数
其他 –
- 返回
真
- 返回
假
-
inline constexpr bool operator==(TensorFormat::Value other) const¶
TensorFormat 的比较运算符。
- 参数
其他 –
- 返回
真
- 返回
假
-
inline constexpr bool operator!=(TensorFormat other) const¶
TensorFormat 的比较运算符。
- 参数
其他 –
- 返回
真
- 返回
假
-
inline constexpr bool operator!=(TensorFormat::Value other) const¶
TensorFormat 的比较运算符。
- 参数
其他 –
- 返回
真
- 返回
假
-
enum Value¶