MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / broadcast

Function broadcast

tensorflow/python/ops/nccl_ops.py:173–186  ·  view source on GitHub ↗

Returns a tensor that can be efficiently transferred to other devices. Args: tensor: The tensor to send; must be assigned to a GPU device. Returns: A tensor with the value of `src_tensor`, which can be used as input to ops on other GPU devices.

(tensor)

Source from the content-addressed store, hash-verified

171
172
173def broadcast(tensor):
174 """Returns a tensor that can be efficiently transferred to other devices.
175
176 Args:
177 tensor: The tensor to send; must be assigned to a GPU device.
178
179 Returns:
180 A tensor with the value of `src_tensor`, which can be used as input to
181 ops on other GPU devices.
182 """
183 _check_device(tensor)
184
185 with ops.device(tensor.device):
186 return gen_nccl_ops.nccl_broadcast(input=tensor, shape=tensor.shape)
187
188
189@ops.RegisterGradient('NcclBroadcast')

Callers

nothing calls this directly

Calls 2

_check_deviceFunction · 0.85
deviceMethod · 0.45

Tested by

no test coverage detected