MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / _dummy_input

Function _dummy_input

imperative/python/megengine/distributed/functional.py:115–121  ·  view source on GitHub ↗
(shape, dtype, device=None)

Source from the content-addressed store, hash-verified

113
114
115def _dummy_input(shape, dtype, device=None):
116 if device is None:
117 device = get_default_device()
118 inp = Tensor(0, dtype=dtype, device=device)
119 if len(shape) > 0:
120 inp = inp._broadcast(shape)
121 return inp
122
123
124class _ReduceSum(Function):

Callers 2

broadcastFunction · 0.85
scatterFunction · 0.85

Calls 3

_broadcastMethod · 0.80
get_default_deviceFunction · 0.50
TensorClass · 0.50

Tested by

no test coverage detected