Tensorflow學習: 乘法demo
阿新 • • 發佈:2018-12-23
2017-05-03 11:18 104人閱讀 評論(0) 收藏 舉報
分類:
本文注意:
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: [email protected]
@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}))