import tensorflow as tf #create nodes node1=tf.constant(3.0,tf.float32) node2=tf.constant(4.0) node3=tf.add(node1,node2) print(node1,node2) sess=tf.Session() print(sess.run([node1,node2])) print("node3:",node3) print("sess.run(node3):",sess.run(node3)) #define placeorder which is a promise to provide value later a=tf.placeholder(tf.float32) b=tf.placeholder(tf.float32) adder_node=a+b #that can be considered as hidden logic method #Specify the method print(sess.run(adder_node,feed_dict={a:3,b:4.5})) print(sess.run(adder_node,feed_dict={a:[1,3],b:[2,4]}))
Tensorflow Learning note1
最新推荐文章于 2024-09-13 08:20:47 发布