标签:python2 ted creat asp pre var print tensor variable
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 6 10:16:37 2018
@author: myhaspl
@email:myhaspl@myhaspl.com
"""
import tensorflow as tf
my_var=tf.Variable(1)
mutop=my_var.assign(my_var*3)
init=tf.initialize_all_variables()
with tf.Session() as sess:
sess.run(init)
print sess.run(mutop)
print sess.run(mutop)
print sess.run(mutop)
3
9
27
标签:python2 ted creat asp pre var print tensor variable
原文地址:http://blog.51cto.com/13959448/2325260