def context_managers(self, kwargs): run_eagerly = kwargs.pop('run_eagerly', None) if run_eagerly is not None: return [test_utils.run_eagerly_scope(run_eagerly)] else: return []
def _v2_function_test(f, test_or_class, *args, **kwargs): with tf.__internal__.eager_context.eager_mode(): with test_utils.run_eagerly_scope(False): f(test_or_class, *args, **kwargs)
def _v1_session_test(f, test_or_class, config, *args, **kwargs): with tf.compat.v1.get_default_graph().as_default(): with test_utils.run_eagerly_scope(False): with test_or_class.test_session(config=config): f(test_or_class, *args, **kwargs)