1. 程式人生 > >tensorflow-單變數初始化

tensorflow-單變數初始化

 # -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
import tensorflow as tf
a=tf.Variable(6,dtype=tf.int32)
b=tf.Variable(3,dtype=tf.int32)
res=tf.div(a,b)
with tf.Session() as sess:
    sess.run(a.initializer)
    sess.run(b.initializer)
    print sess.run(res)