torch.cuda.temperature
-
torch.cuda.temperature(device=None)[source][source]
返回 GPU 传感器平均温度,单位为摄氏度(Centigrades)。
平均温度是根据 nvidia-smi 给出的过去样本周期计算的。
- 参数:
device (torch.device 或 int,可选) – 选择设备。返回当前设备的统计信息,给定由 current_device()
,如果 device
是 None
(默认)。
- 返回类型:
int
警告:每个样本周期可能在 1 秒到 1/6 秒之间,具体取决于查询的产品。