torch.cuda.get_device_capability¶ torch.cuda.get_device_capability(device=None)[source][source]¶ 獲取裝置的 cuda 能力。 引數 device (torch.device 或 int 或 str, 可選) – 指定返回裝置能力的裝置。如果此引數為負整數,此函式不執行任何操作 (no-op)。如果 device 為 None(預設值),則使用由 current_device() 給定的當前裝置。 返回 裝置的 cuda 主要和次要能力 返回型別 tuple(int, int)