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

Function tfadd_with_ckpt

tensorflow/compiler/aot/tests/make_test_graphs.py:48–60  ·  view source on GitHub ↗
(out_dir)

Source from the content-addressed store, hash-verified

46
47
48def tfadd_with_ckpt(out_dir):
49 x = array_ops.placeholder(dtypes.int32, name='x_hold')
50 y = variables.VariableV1(constant_op.constant([0]), name='y_saved')
51 math_ops.add(x, y, name='x_y_sum')
52
53 init_op = variables.global_variables_initializer()
54 saver = saver_lib.Saver(write_version=saver_pb2.SaverDef.V1)
55 with session.Session() as sess:
56 sess.run(init_op)
57 sess.run(y.assign(y + 42))
58 # Without the checkpoint, the variable won't be set to 42.
59 ckpt = os.path.join(out_dir, 'test_graph_tfadd_with_ckpt.ckpt')
60 saver.save(sess, ckpt)
61
62
63def tfadd_with_ckpt_saver(out_dir):

Callers

nothing calls this directly

Calls 8

saveMethod · 0.95
placeholderMethod · 0.45
constantMethod · 0.45
addMethod · 0.45
SessionMethod · 0.45
runMethod · 0.45
assignMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected