美文网首页
TensotFlow 应用实例:04-placeholder的使

TensotFlow 应用实例:04-placeholder的使

作者: iccccing | 来源:发表于2017-06-27 20:01 被阅读0次

    TensotFlow 应用实例:04-placeholder的使用

    本文是我在学习TensotFlow 的时候所记录的笔记,共享出来希望能够帮助一些需要的人。

    placeholder因为解释为占位符,在TensotFlow当中也就是用来占位的,代码如下:

    import tensorflow as tf
    
    # 需要指定类型,和结构,这里没有指定结构
    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.]}))
    
    

    本文代码GitHub地址 tensorflow_learning_notes

    相关文章

      网友评论

          本文标题:TensotFlow 应用实例:04-placeholder的使

          本文链接:https://www.haomeiwen.com/subject/oiaecxtx.html