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

Function immutable_tensor

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

Source from the content-addressed store, hash-verified

259
260
261def immutable_tensor():
262 np_arr = np.array([[1, 2], [3, 4]], dtype=np.int32)
263 np_arr.flags.writeable = False
264 tensor = pa.Tensor.from_numpy(np_arr)
265 assert not tensor.is_mutable
266 return tensor
267
268
269@check_bytes_allocated

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected