• Home
  • Raw
  • Download

Lines Matching full:devices

17 def broadcast(tensor, devices=None, *, out=None):  argument
18 r"""Broadcasts a tensor to specified GPU devices.
22 devices (Iterable[torch.device, str or int], optional): an iterable of
23 GPU devices, among which to broadcast.
28 Exactly one of :attr:`devices` and :attr:`out` must be specified.
31 - If :attr:`devices` is specified,
33 :attr:`devices`.
39 if not ((devices is None) ^ (out is None)):
41 … f"Exactly one of 'devices' and 'out' must be specified, but got devices={devices} and out={out}"
43 if devices is not None:
44 devices = [_get_device_index(d) for d in devices]
45 return torch._C._broadcast(tensor, devices)
50 def broadcast_coalesced(tensors, devices, buffer_size=10485760): argument
58 devices (Iterable[torch.device, str or int]): an iterable of GPU
59 devices, among which to broadcast.
63 A tuple containing copies of :attr:`tensor`, placed on :attr:`devices`.
65 devices = [_get_device_index(d) for d in devices]
67 return torch._C._broadcast_coalesced(tensors, devices, buffer_size)
168 def scatter(tensor, devices=None, chunk_sizes=None, dim=0, streams=None, *, out=None): argument
173 devices (Iterable[torch.device, str or int], optional): an iterable of
174 GPU devices, among which to scatter.
176 each device. It should match :attr:`devices` in length and sums to
190 Exactly one of :attr:`devices` and :attr:`out` must be specified. When
195 - If :attr:`devices` is specified,
197 :attr:`devices`.
204 devices = [_get_device_index(d) for d in devices]
205 return tuple(torch._C._scatter(tensor, devices, chunk_sizes, dim, streams))
207 if devices is not None:
209 … f"'devices' must not be specified when 'out' is specified, but got devices={devices}"
219 r"""Gathers tensors from multiple GPU devices.