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

Function copy_test

imperative/python/test/unit/functional/test_tensor.py:911–918  ·  view source on GitHub ↗
(dst, src, network)

Source from the content-addressed store, hash-verified

909
910
911def copy_test(dst, src, network):
912 data = np.random.random((2, 3)).astype(np.float32)
913 x = make_tensor(data, device=src, network=network)
914 y = F.copy(x, dst)
915 assert np.allclose(data, y.numpy())
916 if network is None:
917 z = x.to(dst)
918 assert np.allclose(data, z.numpy())
919
920
921@pytest.mark.require_ngpu(1)

Callers 3

test_copy_h2dFunction · 0.85
test_copy_d2hFunction · 0.85
test_copy_d2dFunction · 0.85

Calls 5

make_tensorFunction · 0.90
astypeMethod · 0.45
copyMethod · 0.45
numpyMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected