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

Method test_docstring

tensorflow/python/saved_model/save_test.py:296–310  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

294 {"output_0": 7.}, _import_and_infer(save_dir, {"x": 3.}))
295
296 def test_docstring(self):
297
298 class Adder(module.Module):
299
300 @def_function.function(input_signature=[tensor_spec.TensorSpec(
301 shape=None, dtype=dtypes.float32)])
302 def add(self, x):
303 return x + x + 1.
304
305 to_save = Adder()
306 to_save.add(constant_op.constant(1.))
307 save_dir = os.path.join(self.get_temp_dir(), "saved_model")
308 save.save(to_save, save_dir)
309 self.assertAllClose({"output_0": 7.},
310 _import_and_infer(save_dir, {"x": 3.}))
311
312 def test_datastructures(self):
313

Callers

nothing calls this directly

Calls 8

addMethod · 0.95
get_temp_dirMethod · 0.80
AdderClass · 0.70
_import_and_inferFunction · 0.70
constantMethod · 0.45
joinMethod · 0.45
saveMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected