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

Function func

imperative/python/test/unit/random/test_rng.py:690–703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

688 assert sum_result(out, np.sort) == 1000
689
690 def func():
691 out = m1.permutation(Tensor(7))
692 out_shp = out.shape
693 if isinstance(out_shp, tuple):
694 assert out_shp == (1,)
695 else:
696 assert all(out.shape.numpy() == np.array([1]))
697 n, m = 6, 3
698 out = m1.permutation(Tensor(np.arange(n * m), dtype="float32").reshape(n, m))
699 out_shp = out.shape
700 if isinstance(out_shp, tuple):
701 assert out_shp == (n, m)
702 else:
703 assert all(out.shape.numpy() == np.array([n, m]))
704
705 func = trace(symbolic=symbolic)(func)
706 func()

Callers 15

test_PermutationRNGFunction · 0.70
run_indexFunction · 0.50
_pixel_shuffle_cppFunction · 0.50
implMethod · 0.50
stbi_write_png_to_funcFunction · 0.50
decrypt_memoryMethod · 0.50
wrapperFunction · 0.50
wrapperFunction · 0.50
wrappedFunction · 0.50
wrappedFunction · 0.50
wrappedFunction · 0.50

Calls 5

TensorClass · 0.90
permutationMethod · 0.80
arrayMethod · 0.80
numpyMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected