MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_raise_bad_numpy_magic

Function test_raise_bad_numpy_magic

dali/test/python/decoder/test_numpy.py:139–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137
138@raises(RuntimeError, "Got bad magic string for numpy header")
139def test_raise_bad_numpy_magic():
140 def bad_source():
141 yield (np.zeros(100, dtype=np.uint8),)
142
143 @pipeline_def(batch_size=1, num_threads=1)
144 def pipe():
145 encoded_npy = fn.external_source(
146 source=bad_source(), num_outputs=1, batch=False, ndim=1, dtype=DALIDataType.UINT8
147 )
148 decoded = fn.decoders.numpy(encoded_npy)
149 return decoded
150
151 p = pipe()
152 p.build()
153 p.run()
154
155
156@raises(RuntimeError, "All samples in the dataset must have the same data type")

Callers

nothing calls this directly

Calls 3

pipeFunction · 0.70
buildMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected