其他分享
首页 > 其他分享> > TensorFlow-placeholder传入值

TensorFlow-placeholder传入值

作者:互联网

import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior()
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

input1 = tf.placeholder(tf.float32)		#定义结构
input2 = tf.placeholder(tf.float32)


output = tf.multiply(input1,input2)		#矩阵相乘

with tf.Session() as sess:
    print(sess.run(output,feed_dict={input1:[7.],input2:[2.]}))#开始运行

标签:input2,sess,input1,传入,output,tf,TensorFlow,placeholder
来源: https://www.cnblogs.com/java-six/p/16223419.html