PyTorch torch.get_num_threads 関数


Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

torch.get_num_threadsPyTorch で内部並列計算のスレッド数を取得するための関数です。

関数定義

torch.get_num_threads()

使用例

例

import torch

# 現在のスレッド数を取得
num_threads = torch.get_num_threads()
print("現在のスレッド数:", num_threads)

Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

その他の拡張