MCPcopy Create free account
hub / github.com/apple/coremltools / test_index_offset

Function test_index_offset

deps/pybind11/tests/test_numpy_array.py:74–78  ·  view source on GitHub ↗
(arr, args, ret)

Source from the content-addressed store, hash-verified

72 ("args", "ret"), [([], 0), ([0], 0), ([1], 3), ([0, 1], 1), ([1, 2], 5)]
73)
74def test_index_offset(arr, args, ret):
75 assert m.index_at(arr, *args) == ret
76 assert m.index_at_t(arr, *args) == ret
77 assert m.offset_at(arr, *args) == ret * arr.dtype.itemsize
78 assert m.offset_at_t(arr, *args) == ret * arr.dtype.itemsize
79
80
81def 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