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

Function test_swapped_ends

dali/test/python/operator_2/test_subscript.py:87–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85
86
87def test_swapped_ends():
88 data = [np.uint8([1, 2, 3]), np.uint8([1, 2])]
89 src = fn.external_source(lambda: data)
90 pipe = index_pipe(src, lambda x: x[2:1])
91 inp, cpu, gpu = tuple(out.as_cpu() for out in pipe.run())
92 for i in range(len(inp)):
93 x = inp.at(i)
94 assert np.array_equal(x[2:1], cpu.at(i))
95 assert np.array_equal(x[2:1], gpu.at(i))
96
97
98def test_noop():

Callers

nothing calls this directly

Calls 4

index_pipeFunction · 0.85
uint8Method · 0.80
runMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected