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.]}))#开始运行