(self)
| 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. |
nothing calls this directly
no test coverage detected