Tensorflow学习: Placeholder占位符
本文注意:
1. placeholder应用与feed_dcit是绑定的
2. 在r0.12版本中tensorflow的乘法是tensorflow.multiply(x,y)
# -*- coding: utf-8 -*-
"""
Created on Wed May 3 11:05:30 2017
E-mail: Eric2014_Lv@sjtu.edu.cn
@author: DidiLv
"""
import tensorflow as tf
input1 = tf.placeholder(tf.float32) # float32 type variabvle by dfault
input2 = tf.placeholder(tf.float32)
output = tf.multiply(input1,input2) # need to be notice
with tf.Session() as sess:
print(sess.run(output,feed_dict={input1:7, input2:2}))
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。