MCPcopy Create free account
hub / github.com/numpy/numpy / _check_assignment

Function _check_assignment

numpy/core/tests/test_mem_overlap.py:55–66  ·  view source on GitHub ↗

Check assignment arr[dstidx] = arr[srcidx] works.

(srcidx, dstidx)

Source from the content-addressed store, hash-verified

53
54
55def _check_assignment(srcidx, dstidx):
56 """Check assignment arr[dstidx] = arr[srcidx] works."""
57
58 arr = np.arange(np.prod(shape)).reshape(shape)
59
60 cpy = arr.copy()
61
62 cpy[dstidx] = arr[srcidx]
63 arr[dstidx] = arr[srcidx]
64
65 assert_(np.all(arr == cpy),
66 'assigning arr[%s] = arr[%s]' % (dstidx, srcidx))
67
68
69def test_overlapping_assignments():

Callers 1

Calls 5

assert_Function · 0.90
reshapeMethod · 0.80
prodMethod · 0.45
copyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected