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

Function test_tensor_ipc_read_from_compressed

python/pyarrow/tests/test_tensor.py:118–130  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

116
117@pytest.mark.gzip
118def test_tensor_ipc_read_from_compressed(tempdir):
119 # ARROW-5910
120 data = np.random.randn(10, 4)
121 tensor = pa.Tensor.from_numpy(data)
122
123 path = tempdir / 'tensor-compressed-file'
124
125 out_stream = pa.output_stream(path, compression='gzip')
126 pa.ipc.write_tensor(tensor, out_stream)
127 out_stream.close()
128
129 result = pa.ipc.read_tensor(pa.input_stream(path, compression='gzip'))
130 assert result.equals(tensor)
131
132
133def test_tensor_ipc_strided(tmpdir):

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected