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