MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testExecuteBasicAsync

Method testExecuteBasicAsync

tensorflow/python/eager/core_test.py:611–632  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

609 self.assertAllEqual(15, product)
610
611 def testExecuteBasicAsync(self):
612 with context.execution_mode(context.ASYNC):
613 three = constant_op.constant(3)
614 five = constant_op.constant(5)
615 product = execute(
616 b'Mul',
617 num_outputs=1,
618 inputs=[three, five],
619 attrs=('T', three.dtype.as_datatype_enum))[0]
620 self.assertAllEqual(15, product)
621 # Error: Invalid arguments
622 context.set_execution_mode(context.ASYNC)
623 with self.assertRaises(errors.InvalidArgumentError):
624 execute(
625 b'MatMul',
626 num_outputs=1,
627 inputs=[three, five],
628 attrs=('transpose_a', False, 'transpose_b', False, 'T',
629 three.dtype.as_datatype_enum))
630 context.context().executor.wait()
631 context.context().executor.clear_error()
632 context.context().execution_mode = context.SYNC
633
634 def testExecuteTooManyNumOutputs(self):
635 # num_outputs provided is 50, but only one output is produced.

Callers

nothing calls this directly

Calls 7

execution_modeMethod · 0.80
clear_errorMethod · 0.80
executeFunction · 0.70
constantMethod · 0.45
assertAllEqualMethod · 0.45
waitMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected