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

Function test_normal_decoding

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

Source from the content-addressed store, hash-verified

31
32
33def test_normal_decoding():
34 num_samples = 8
35 data = [np.random.normal(size=(2, s)).astype(np.float32) for s in range(num_samples)]
36
37 @pipeline_def(batch_size=1, num_threads=1)
38 def pipe():
39 encoded_npy = fn.external_source(
40 source=box_source(data), num_outputs=1, batch=False, ndim=1, dtype=DALIDataType.UINT8
41 )
42 decoded = fn.decoders.numpy(encoded_npy)
43 return decoded
44
45 p = pipe()
46 p.build()
47
48 for i in range(num_samples):
49 output = p.run()
50 test = np.asarray(output[0][0])
51 assert np.all(test == data[i])
52
53
54def test_fortran_decoding():

Callers

nothing calls this directly

Calls 4

allMethod · 0.80
pipeFunction · 0.70
buildMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected