快捷方式

结构体 Device

嵌套关系

嵌套类型

结构体文档

struct Device

目标设备的设置数据结构。

公共函数

inline Device()

Device 结构体的构造函数

公共成员

DeviceType device_type

设备设置数据结构。此结构体将包含目标设备相关的参数,例如 device_type、gpu_id、dla_core。

int64_t gpu_id
int64_t dla_core
bool allow_gpu_fallback

(仅在目标 DLA(设备)时使用)如果层在 DLA 上不受支持,则允许引擎在 GPU 上运行这些层

class DeviceType

TensorRT 引擎支持的设备类型

此类别与 c10::DeviceTypes 兼容(但会检查 TRT 支持),但唯一适用的值是 at::kCUDA,它映射到 DeviceType::kGPU

要使用 DataType 类本身,请使用枚举而不是正常实例化进行接口操作

例如 torch_tensorrt::DeviceType type = DeviceType::kGPU;

公共类型

enum Value

支持 DeviceType 类的底层枚举类

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

例如 torch_tensorrt::DeviceType type = DeviceType::kGPU;

enumerator kGPU

目标 GPU 以运行引擎。

enumerator kDLA

目标 DLA 以运行引擎。

公共函数

DeviceType() = default

构造一个新的 设备 类型对象。

inline constexpr DeviceType(Value t)

从内部枚举构造一个新的 设备 类型对象。

DeviceType(c10::DeviceType t)

从 torch 设备枚举构造一个新的 设备 类型对象。注意:唯一有效的值是 torch::kCUDA(不支持 torch::kCPU)

参数

t

inline constexpr operator Value() const

设备 对象获取内部值。

返回

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

DeviceType 的比较运算符。

参数

其他

返回

返回

inline constexpr bool operator!=(DeviceType other) const

DeviceType 的比较运算符。

参数

其他

返回

返回

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

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

查看教程

资源

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

查看资源