def _create_bottom_stack(): return _complete_stack(eager_executor.EagerExecutor())
def _stack_fn(x): del x # Unused return eager_executor.EagerExecutor()
def test_executor_construction_with_no_device_name(self): eager_executor.EagerExecutor()
def _test_ctx(): return execution_context.ExecutionContext(eager_executor.EagerExecutor())
def test_executor_constructor_fails_if_bogus_device_name(self): with self.assertRaises(TypeError): eager_executor.EagerExecutor(10) with self.assertRaises(ValueError): eager_executor.EagerExecutor('Mary had a little lamb.')
def test_executor_construction_with_correct_device_name(self): eager_executor.EagerExecutor('/CPU:0')
def _create_bottom_stack(): return lambda_executor.LambdaExecutor( caching_executor.CachingExecutor( concurrent_executor.ConcurrentExecutor( eager_executor.EagerExecutor())))
def test_executor_constructor_fails_if_not_in_eager_mode(self): with tf.Graph().as_default(): with self.assertRaises(RuntimeError): eager_executor.EagerExecutor()
def test_runs_tf(self): executor_test_utils.test_runs_tf( self, lambda_executor.LambdaExecutor(eager_executor.EagerExecutor()))
def test_with_mnist_training_example(self): executor_test_utils.test_mnist_training(self, eager_executor.EagerExecutor())
def test_something(self): # TODO(b/134543154): Actually test something. transforming_executor.TransformingExecutor(eager_executor.EagerExecutor())
def _make_executor_and_tracer_for_test(support_lambdas=False): tracer = executor_test_utils.TracingExecutor(eager_executor.EagerExecutor()) ex = caching_executor.CachingExecutor(tracer) if support_lambdas: ex = lambda_executor.LambdaExecutor(caching_executor.CachingExecutor(ex)) return ex, tracer
def test_runs_tf(self): executor_test_utils.test_runs_tf(self, eager_executor.EagerExecutor())
def test_close_then_use_executor(self): ex = concurrent_executor.ConcurrentExecutor(eager_executor.EagerExecutor()) ex.close() result = self.use_executor(ex) self.assertIsInstance(result, eager_executor.EagerValue) self.assertEqual(result.internal_representation.numpy(), 11)
def _create_single_worker_stack(): ex = eager_executor.EagerExecutor() ex = concurrent_executor.ConcurrentExecutor(ex) ex = caching_executor.CachingExecutor(ex) return lambda_executor.LambdaExecutor(ex)