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

Function cycle

tensorflow/python/saved_model/load_test.py:73–86  ·  view source on GitHub ↗
(obj, cycles, signatures=None)

Source from the content-addressed store, hash-verified

71
72
73def cycle(obj, cycles, signatures=None):
74 to_save = obj
75 # TODO(vbardiovsky): It would be nice if exported protos reached a fixed
76 # point w.r.t. saving/restoring, ideally after 2nd saving.
77 for _ in range(cycles):
78 path = tempfile.mkdtemp(prefix=test.get_temp_dir())
79 # If available, we'll run the save and restore preferring the GPU. This
80 # just makes sure we aren't throwing errors and have enough
81 # device("CPU") blocks to satisfy the placer.
82 with test_util.use_gpu():
83 save.save(to_save, path, signatures)
84 loaded = load.load(path)
85 to_save = loaded
86 return loaded
87
88
89@parameterized.named_parameters(

Callers 15

test_structure_importMethod · 0.85
test_variablesMethod · 0.85
test_variables_nameMethod · 0.85
test_capture_constantMethod · 0.85
test_control_outputsMethod · 0.85
test_cond_pruneMethod · 0.85
test_capture_assetsMethod · 0.85
test_dedup_assetsMethod · 0.85

Calls 5

mkdtempMethod · 0.80
get_temp_dirMethod · 0.80
rangeFunction · 0.50
saveMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected