Class TensorFormat¶
類別文件¶
-
class TensorFormat¶
TensorFormat 是一個列舉類別,用於定義儲存張量資料的記憶體佈局。
公開型別
-
enum Value¶
支援 TensorFormat 類別的底層列舉類別
如果您需要使用 TensorFormat 類別本身,請使用此列舉介面,而非一般的實例化
例如:torch_tensorrt::TensorFormat type = 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 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
-
enum Value¶