MCPcopy Create free account
hub / github.com/apache/arrow / test_from_dlpack_explicit_copy

Function test_from_dlpack_explicit_copy

python/pyarrow/tests/test_dlpack.py:484–490  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

482@requires_numpy_version("2.1.0")
483@check_bytes_allocated
484def test_from_dlpack_explicit_copy():
485 expected = np.array([1, 2, 3], dtype=np.int64)
486 tensor = pa.Tensor.from_dlpack(expected, copy=True)
487 result = tensor.to_numpy()
488 expected[0] = 100
489 # The data was copied, so mutating the source is not visible.
490 assert result[0] == 1
491
492
493def test_from_dlpack_no_dlpack_method():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected