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

Function test_multiple_skipped_dims

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

Source from the content-addressed store, hash-verified

282
283
284def test_multiple_skipped_dims():
285 data = [
286 np.arange(64, dtype=np.float32).reshape(4, 2, 2, 4),
287 np.arange(120, dtype=np.float32).reshape(4, 2, 3, 5),
288 ]
289 src = fn.external_source(lambda: data, layout="ABCD")
290 pipe = index_pipe(src, lambda x: x[1, :, :, 1])
291 inp, cpu, gpu = tuple(out.as_cpu() for out in pipe.run())
292 for i in range(len(inp)):
293 x = inp.at(i)
294 assert np.array_equal(x[1, :, :, 1], cpu.at(i))
295 assert np.array_equal(x[1, :, :, 1], gpu.at(i))
296
297
298def test_empty_slice():

Callers

nothing calls this directly

Calls 4

index_pipeFunction · 0.85
reshapeMethod · 0.45
runMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected