• 文档 >
  • torch.cuda >
  • torch.cuda.comm.broadcast_coalesced
快捷键

torch.cuda.comm.broadcast_coalesced

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

将一系列张量广播到指定的 GPU 上。

小张量首先合并到缓冲区中,以减少同步次数。

参数:
  • 张量(序列)- 要广播的张量。必须在同一设备上,无论是 CPU 还是 GPU。

  • 设备(Iterable[torch.device, str 或 int])- 在其中广播的 GPU 设备集合。

  • buffer_size(int)- 用于合并的缓冲区最大大小。

返回值:

包含 tensor 副本的元组,放置于 devices


© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源