def test_variable_reuse_with_template(self):
tmpl1 = tf.make_template('test',
tf.contrib.layers.legacy_fully_connected,
num_output_units=8)
output1 = tmpl1(self.input)
output2 = tmpl1(self.input)
with tf.Session() as sess:
tf.global_variables_initializer().run()
out_value1, out_value2 = sess.run([output1, output2])
self.assertAllClose(out_value1, out_value2)
评论列表
文章目录