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