快速鍵

torch.cuda.comm.broadcast_coalesced

torch.cuda.comm.broadcast_coalesced(tensors, devices, buffer_size=10485760)[來源][來源]

將一系列 Tensor 廣播到指定的 GPU。

小型的 Tensor 會先合併到一個緩衝區中,以減少同步的次數。

參數
  • tensors (序列) – 要廣播的 Tensor。必須位於相同的裝置上,無論是 CPU 還是 GPU。

  • devices (Iterable[torch.device, str or int]) – 要在其間廣播的 GPU 裝置的 Iterable。

  • buffer_size (int) – 用於合併的緩衝區的最大大小

傳回

一個包含 tensor 副本的元組,放置在 devices 上。

文件

存取 PyTorch 的完整開發者文件

檢視文件

教學

獲取適用於初學者和進階開發者的深入教學課程

檢視教學

資源

尋找開發資源並取得問題解答

檢視資源