1. 首先引入Tensorflow
    import tensorflow as tf

  2. 定义运算规则和变量
    #placeholder是TensorFlow的占位符节点,可以理解为一种形参,在调用run方法是传递。
    input1 = tf.placeholder(tf.float32)
    input2 = tf.placeholder(tf.float32)
    output = tf.multiply(input1, input2)

  3. 从字典中完成取值
    with tf.Session() as sess:
    print(sess.run(output, feed_dict={input1:[2.5],input2:[3.0]}))

  4. 运算结果:
    Tensorflow中的Feed and Fetch

相关文章:

  • 2021-10-26
  • 2021-12-04
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-01-03
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-12-06
  • 2022-12-23
相关资源
相似解决方案