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

Function test_fill_

imperative/python/test/unit/module/test_init.py:10–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def test_fill_():
11 x = tensor(np.zeros((2, 3, 4)), dtype=np.float32)
12 fill_(x, 5.0)
13
14 np.testing.assert_array_equal(
15 x.numpy(), np.full(shape=(2, 3, 4), fill_value=5.0, dtype=np.float32)
16 )
17
18
19def test_calculate_fan_in_and_fan_out():

Callers

nothing calls this directly

Calls 3

fill_Function · 0.90
zerosMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected