快捷鍵

torch.cuda.comm.reduce_add

torch.cuda.comm.reduce_add(inputs, destination=None)[原始碼][原始碼]

將來自多個 GPU 的 tensors 加總。

所有輸入應具有相符的形狀、dtype 和 layout。輸出 tensor 將具有相同的形狀、dtype 和 layout。

參數
  • inputs (Iterable[Tensor]) – 待加總的 tensors 的 iterable。

  • destination (int, optional) – 輸出將放置的裝置 (預設:目前裝置)。

回傳

包含所有輸入元素級總和的 tensor,放置在 destination 裝置上。

文件

取得 PyTorch 的完整開發人員文件

檢視文件

教學

取得針對初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並獲得您的問題解答

檢視資源