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

Function test_fortran_decoding

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

Source from the content-addressed store, hash-verified

52
53
54def test_fortran_decoding():
55 num_samples = 8
56 data = [np.array(np.random.normal(size=(2, s)), order="F") for s in range(num_samples)]
57
58 @pipeline_def(batch_size=1, num_threads=1)
59 def pipe():
60 encoded_npy = fn.external_source(
61 source=box_source(data), num_outputs=1, batch=False, ndim=1, dtype=DALIDataType.UINT8
62 )
63 decoded = fn.decoders.numpy(encoded_npy)
64 return decoded
65
66 p = pipe()
67 p.build()
68
69 for i in range(num_samples):
70 output = p.run()
71 test = np.asarray(output[0][0])
72 assert np.array_equal(test, data[i])
73
74
75def test_variable_shape():

Callers

nothing calls this directly

Calls 3

pipeFunction · 0.70
buildMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected