快捷方式

類 TensorFormat

類文件

class TensorFormat

TensorFormat 是一個列舉類,用於定義儲存 Tensor 資料的記憶體佈局。

公共型別

enum Value

支援 TensorFormat 類的底層列舉類

如果您需要使用 TensorFormat 類本身,請使用此列舉而不是正常例項化進行介面操作

例如 torch_tensorrt::TensorFormat type = 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 物件的列舉值。

返回

Value

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

TensorFormat 的比較運算子。

引數

other

返回

true

返回

false

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

TensorFormat 的比較運算子。

引數

other

返回

true

返回

false

inline constexpr bool operator!=(TensorFormat other) const

TensorFormat 的比較運算子。

引數

other

返回

true

返回

false

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

TensorFormat 的比較運算子。

引數

other

返回

true

返回

false

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源