快捷方式

TensorFormat 类

类文档

class TensorFormat

TensorFormat 是一个枚举类,它定义了用于存储张量数据内存布局。

公共类型

enum Value

支持 TensorFormat 类底层枚举类

如果您需要使用 TensorFormat 类本身,请使用此枚举而不是正常实例化进行接口

例如 torch_tensorrt::TensorFormat 类型 = TensorFormat::kContiguous;

enumerator kContiguous

连续 / NCHW / 线性。

enumerator kChannelsLast

通道在后 / NHWC。

enumerator kUnknown

哨兵值。

公共函数

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 的比较运算符。

参数

其他

返回

返回

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源