MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_index_offset

Function test_index_offset

tests/test_numpy_array.py:113–117  ·  view source on GitHub ↗
(arr, args, ret)

Source from the content-addressed store, hash-verified

111 ("args", "ret"), [([], 0), ([0], 0), ([1], 3), ([0, 1], 1), ([1, 2], 5)]
112)
113def test_index_offset(arr, args, ret):
114 assert m.index_at(arr, *args) == ret
115 assert m.index_at_t(arr, *args) == ret
116 assert m.offset_at(arr, *args) == ret * arr.dtype.itemsize
117 assert m.offset_at_t(arr, *args) == ret * arr.dtype.itemsize
118
119
120def test_dim_check_fail(arr):

Callers

nothing calls this directly

Calls 2

index_atMethod · 0.80
offset_atMethod · 0.80

Tested by

no test coverage detected