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

Function sum_result

imperative/python/test/unit/random/test_rng.py:303–304  ·  view source on GitHub ↗
(res, fun)

Source from the content-addressed store, hash-verified

301
302 def test_permutation_op_dtype(dtype):
303 def sum_result(res, fun):
304 return sum([1 if i == v else 0 for i, v in enumerate(fun(res.numpy()))])
305
306 shape = Tensor((n,), dtype="int32")
307 op = PermutationRNG(seed=get_global_rng_seed(), dtype=dtype)

Callers 2

test_PermutationRNGFunction · 0.85

Calls 3

sumFunction · 0.85
funFunction · 0.50
numpyMethod · 0.45

Tested by

no test coverage detected