Tensorflow学习: 乘法demo

 

Tensorflow学习: Placeholder占位符

标签: tensorflow
  104人阅读  评论(0)  收藏  举报
  分类:
Tensorflow(6) 

本文注意: 
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}))

你可能感兴趣的:(tensorflow)