快捷鍵

Class TensorFormat

類別文件

class TensorFormat

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

公開型別

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 operator Value() const

取得 TensorFormat 物件的列舉值。

回傳

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 的全面開發者文件

檢視文件

教學

取得初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源