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

Function decorated

tensorflow/python/framework/test_util.py:980–997  ·  view source on GitHub ↗
(self, run_mode, *args, **kwargs)

Source from the content-addressed store, hash-verified

978 ("_function", "function"))
979 @functools.wraps(f)
980 def decorated(self, run_mode, *args, **kwargs):
981 if run_mode == "v1_graph":
982 with ops.Graph().as_default():
983 f(self, *args, **kwargs)
984 elif run_mode == "function":
985
986 @def_function.function
987 def function_in_eager():
988 f(self, *args, **kwargs)
989
990 # Create a new graph for the eagerly executed version of this test for
991 # better isolation.
992 graph_for_eager_test = ops.Graph()
993 with graph_for_eager_test.as_default(), context.eager_mode():
994 function_in_eager()
995 ops.dismantle_graph(graph_for_eager_test)
996 else:
997 return ValueError("Unknown run mode %s" % run_mode)
998
999 return decorated
1000

Callers

nothing calls this directly

Calls 15

as_defaultMethod · 0.95
is_xla_enabledFunction · 0.90
function_in_eagerFunction · 0.85
assert_no_new_tensorsFunction · 0.85
run_eagerlyFunction · 0.85
bound_fFunction · 0.85
is_gpu_availableFunction · 0.85
fFunction · 0.50
funcFunction · 0.50
GraphMethod · 0.45
test_sessionMethod · 0.45

Tested by

no test coverage detected