def test_executor_call_unsupported_intrinsic(self): dummy_intrinsic = intrinsic_defs.IntrinsicDef( 'DUMMY_INTRINSIC', 'dummy_intrinsic', computation_types.AbstractType('T')) comp = pb.Computation(type=type_serialization.serialize_type(tf.int32), intrinsic=pb.Intrinsic(uri='dummy_intrinsic')) loop = asyncio.get_event_loop() executor = composing_executor.ComposingExecutor( _create_bottom_stack(), [_create_worker_stack() for _ in range(3)]) with self.assertRaises(NotImplementedError): v1 = loop.run_until_complete(executor.create_value(comp, tf.int32)) loop.run_until_complete(executor.create_call(v1, None))
def _create_composite_stack(children): return _complete_stack( composing_executor.ComposingExecutor(_create_bottom_stack(), children))
def _create_composite_stack( children, unplaced_ex_factory: UnplacedExecutorFactory ) -> executor_base.Executor: unplaced_executor = unplaced_ex_factory.create_executor() return _wrap_executor_in_threading_stack( composing_executor.ComposingExecutor(unplaced_executor, children))
def create_aggregation_stack(children): return composing_executor.ComposingExecutor(create_bottom_stack(), children)
def _create_middle_stack(children): return reference_resolving_executor.ReferenceResolvingExecutor( caching_executor.CachingExecutor( composing_executor.ComposingExecutor(_create_bottom_stack(), children)))