函数形式:

tf.placeholder(
    dtype,
    shape=None,
    name=None
)

参数:

  1. dtype:数据类型。常用的是tf.float32,tf.float64等数值类型
  2. shape:数据形状。默认是None,就是一维值,也可以是多维(比如[2,3], [None, 3]表示列是3,行不定)
  3. name:名称,可以理解为变量的名字(自变量)
import tensorflow as tf
import numpy as np 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:[3.], input2: [4.]}) #运行的时候再具体赋值。

https://blog.csdn.net/kdongyi/article/details/82343712

tf.placeholder函数说明的更多相关文章

  1. Tensorflow函数——tf.placeholder()函数

    tf.placeholder()函数 Tensorflow中的palceholder,中文翻译为占位符,什么意思呢? 在Tensoflow2.0以前,还是静态图的设计思想,整个设计理念是计算流图,在编 ...

  2. TensorFlow函数(一)tf.placeholder()函数

    tf.placeholder(dtype, shape=None, name=None) 此函数用于定义过程,在执行的时候再赋具体的值 参数: dtype:数据类型.常用的是tf.float32,tf ...

  3. tf.placeholder类似函数中的形参

    tf.placeholder(dtype, shape=None, name=None) 此函数可以理解为形参,用于定义过程,在执行的时候再赋具体的值 参数: dtype:数据类型.常用的是tf.fl ...

  4. TensorFlow 辨异 —— tf.placeholder 与 tf.Variable

    https://blog.csdn.net/lanchunhui/article/details/61712830 https://www.cnblogs.com/silence-tommy/p/70 ...

  5. tf.placeholder使用说明

    tf.placeholder(dtype, shape=None, name=None) placeholder,占位符,在tensorflow中类似于函数参数,运行时必须传入值. dtype:数据类 ...

  6. tf.Variable()、tf.get_variable()和tf.placeholder()

    1.tf.Variable() tf.Variable(initializer,name) 功能:tf.Variable()创建变量时,name属性值允许重复,检查到相同名字的变量时,由自动别名机制创 ...

  7. tensorflow学习之tf.placeholder

    placeholder函数相当于一个占位符,tf.placeholder(dtype, shape=None, name=None) dtype:数据类型.常用的是tf.float32,tf.floa ...

  8. tf.placeholde函数解释与用法

    函数原型:tf.placeholder(dtype, shape=None, name=None) 使用说明:该函数用于得到传递进来的真实的训练样本.同时也可以理解为形参, 用于定义过程,在执行的时候 ...

  9. tensorflow 笔记14:tf.expand_dims和tf.squeeze函数

    tf.expand_dims和tf.squeeze函数 一.tf.expand_dims() Function tf.expand_dims(input, axis=None, name=None, ...

随机推荐

  1. Flink 源码解析 —— 项目结构一览

    Flink 源码项目结构一览 https://t.zsxq.com/MNfAYne 博客 1.Flink 从0到1学习 -- Apache Flink 介绍 2.Flink 从0到1学习 -- Mac ...

  2. Java学习:static 关键字概述

    static 关键字概述 一旦用了static关键字,那么这样的内容不再属于对象自己.而是属于类的,所以凡是本类的对象,都共享同一份. 如果没有static关键字,那么必须首先创建对象,然后通过对象才 ...

  3. 使用位运算实现int32位 整数的加减乘除

    我觉得比较难想的是加法吧. 首先加法,脑海中脑补二进制加法,相同位相加,超过2 ,则进1,留0 那么用位运算怎么实现呢?其实理解了异或和与操作,就很容易想出来了. 我觉得异或操作和与操作完全就是实现加 ...

  4. java基础 接口常量

    /** * 接口当中也可以定义"成员变量", 但是必须使用public static final三个关键字进行修饰 * 从效果上看,这其实就是接口的[常用] * 格式: * pub ...

  5. Python进阶----pymysql模块的使用,单表查询

    Python进阶----pymysql模块的使用,单表查询 一丶使用pymysql ​   ​   1.下载pymysql包: pip3 install pymysql ​​   ​   2.编写代码 ...

  6. 连接池未注册org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'XXX'

    代码之前一直好好的,写了一个定时器后报错,本地测试为了立马能执行就用cron表达式* * * * * ?,为了只执行一次在最后面加上Thread.sleep(1000*3600*24)睡眠二十四小时从 ...

  7. 含有动态未知字段的 JSON 反序列化

    一般来说,正常的 json 长这个模样: { 'Name': 'Bad Boys', 'ReleaseDate': '1995-4-7T00:00:00', 'Genres': [ 'Action', ...

  8. 原生JS实现上拉下拉列表

    话不多说,代码上来,有些知识点直接就在注释里 HTML <div class="list-down"> <button id="btn"> ...

  9. requestAnimationFrame ---- 请求动画帧。

    window.requestAnimationFrame() 告诉浏览器——你希望执行一个动画,并且要求浏览器在下次重绘之前调用指定的回调函数更新动画.该方法需要传入一个回调函数作为参数,该回调函数会 ...

  10. Product settype acts as a very important role in CRM WebClient UI architecture

    Product settype acts as a very important role in CRM WebClient UI architecture. The GenIL layer know ...