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

Function pipeline_op

dali/test/python/conditionals/test_nests.py:96–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95 @pipeline_def(enable_conditionals=True, num_threads=4, batch_size=8, device_id=0)
96 def pipeline_op():
97 pred = fn.external_source(source=lambda x: np.array(x.idx_in_batch % 2), batch=False)
98 data = types.Constant(np.array(42), device="cpu")
99 if pred:
100 out = {"out": data - 1}
101 else:
102 out = {"out": data + 1}
103 return out["out"]
104
105 pipe_op = pipeline_op()
106 (out,) = pipe_op.run()

Callers 1

test_dictsFunction · 0.85

Calls 1

ConstantMethod · 0.80

Tested by

no test coverage detected