Skip to content

Commit 09a9ad9

Browse files
author
Mofan Zhou
committed
create tf7
1 parent edc92bd commit 09a9ad9

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

tensorflowTUT/tensorflow5_example2.py

-33
This file was deleted.

tensorflowTUT/tensorflow7_variable.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
import tensorflow as tf
77

88
state = tf.Variable(0, name='counter')
9+
#print(state.name)
910
one = tf.constant(1)
1011

1112
new_value = tf.add(state, one)
1213
update = tf.assign(state, new_value)
1314

14-
init = tf.initialize_all_variables() # must have
15+
init = tf.initialize_all_variables() # must have if define variable
1516

1617
with tf.Session() as sess:
17-
sess.run(init) # run and activate
18+
sess.run(init)
1819
for _ in range(3):
1920
sess.run(update)
2021
print(sess.run(state))
22+

0 commit comments

Comments
 (0)