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

Class HasDatastructures

tensorflow/python/saved_model/save_test.py:314–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 def test_datastructures(self):
313
314 class HasDatastructures(util.Checkpoint):
315
316 def __init__(self):
317 self.a = [1.]
318 self.a.append(variables.Variable(2.))
319 self.b = {"a": variables.Variable(3.)}
320
321 @def_function.function(input_signature=[tensor_spec.TensorSpec(
322 shape=None, dtype=dtypes.float32)])
323 def add(self, x):
324 return x + math_ops.add_n(self.a) + self.b["a"]
325
326 to_save = HasDatastructures()
327 to_save.add(constant_op.constant(1.))

Callers 1

test_datastructuresMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_datastructuresMethod · 0.68