MCPcopy Index your code
hub / github.com/numpy/numpy / _check_assignment

Function _check_assignment

numpy/_core/tests/test_mem_overlap.py:53–64  ·  view source on GitHub ↗

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

(srcidx, dstidx)

Source from the content-addressed store, hash-verified

51
52
53def _check_assignment(srcidx, dstidx):
54 """Check assignment arr[dstidx] = arr[srcidx] works."""
55
56 arr = np.arange(np.prod(shape)).reshape(shape)
57
58 cpy = arr.copy()
59
60 cpy[dstidx] = arr[srcidx]
61 arr[dstidx] = arr[srcidx]
62
63 assert_(np.all(arr == cpy),
64 f'assigning arr[{dstidx}] = arr[{srcidx}]')
65
66
67def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…