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

Function test_invocation_tensor

dali/test/python/experimental_mode/test_invocation.py:183–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181
182
183def test_invocation_tensor():
184 op = MockOperator()
185 b1 = MockTensor(np.int32([1, 2, 3]))
186 b2 = MockTensor(np.int32([4, 5, 6]))
187 b3 = MockTensor(np.int32([7, 8, 9]))
188 a = MockTensor(np.int32([10, 20, 30]))
189
190 inv = Invocation(op, 0, inputs=[b1, b2, b3], args={"addend": a}, is_batch=False)
191 inv.run(ndd.EvalContext.current())
192 assert inv.values(ndd.EvalContext.current()) == (
193 MockTensor(np.int32([11, 22, 33])),
194 MockTensor(np.int32([14, 25, 36])),
195 MockTensor(np.int32([17, 28, 39])),
196 )
197
198
199def test_invocation_batch():

Callers

nothing calls this directly

Calls 7

runMethod · 0.95
valuesMethod · 0.95
InvocationClass · 0.90
MockOperatorClass · 0.85
MockTensorClass · 0.85
int32Method · 0.80
currentMethod · 0.45

Tested by

no test coverage detected