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

Function fill

imperative/python/megengine/xla/rules/tensor.py:193–196  ·  view source on GitHub ↗
(value, shape, dtype=np.float32)

Source from the content-addressed store, hash-verified

191
192
193def fill(value, shape, dtype=np.float32):
194 assert isinstance(value, (int, float, bool))
195 value = np.asarray(value, dtype=dtype)
196 return broadcast_to(HLOTensor(value, dtype=dtype), shape)
197
198
199def ones(shape, dtype=np.float32):

Callers 15

avgpoolingFunction · 0.85
avgpooling_gradFunction · 0.85
fake_op_lowerFunction · 0.85
argsort_backward_lowerFunction · 0.85
onesFunction · 0.85
zerosFunction · 0.85
fill_likeFunction · 0.85
fill_lowerFunction · 0.85
fill_like_lowerFunction · 0.85
runMethod · 0.85
genMethod · 0.85

Calls 2

HLOTensorClass · 0.85
broadcast_toFunction · 0.70

Tested by 5

runMethod · 0.68
genMethod · 0.68
genMethod · 0.68
genMethod · 0.68
genMethod · 0.68