当前位置:网站首页>tf.placeholder
tf.placeholder
2022-07-22 05:07:00 【Wanderer001】
参考 tf.placeholder - 云+社区 - 腾讯云
Inserts a placeholder for a tensor that will be always fed.
Aliases:
tf.placeholder(
dtype,
shape=None,
name=None
)
Important: This tensor will produce an error if evaluated. Its value must be fed using the feed_dict
optional argument to Session.run(), Tensor.eval(), or Operation.run().
For example:
x = tf.compat.v1.placeholder(tf.float32, shape=(1024, 1024))
y = tf.matmul(x, x)
with tf.compat.v1.Session() as sess:
print(sess.run(y)) # ERROR: will fail because x was not fed.
rand_array = np.random.rand(1024, 1024)
print(sess.run(y, feed_dict={x: rand_array})) # Will succeed.
Args:
dtype
: The type of elements in the tensor to be fed.shape
: The shape of the tensor to be fed (optional). If the shape is not specified, you can feed a tensor of any shape.name
: A name for the operation (optional).
Returns:
- A
Tensor
that may be used as a handle for feeding a value, but not evaluated directly.
Raises:
RuntimeError
: if eager execution is enabled
Eager Compatibility:
- Placeholders are not compatible with eager execution.
边栏推荐
- AT2336 [ARC069D] Flags
- arm64环境下,golang的第三方库hajimehoshi/oto依赖alsa-lib和cgo的解决方案
- On the continuous chain use of promise then
- CF464E The Classic Problem
- Bryntum Scheduler Pro 5.0.6 \Gantt\Crack
- A Mobile Telematics Pattern Recognition Framework for Driving Behavior Extraction
- 高数_第3章重积分
- ORA-16525 dg broker不可用
- 【网页性能优化】-—— 关于图片懒加载
- 【vs】如何查看线程阻塞在哪里
猜你喜欢
Bryntum Scheduler Pro 5.0.6 \Gantt\Crack
数据湖:数据湖技术架构演进
UE4 将蓝图写在Actor类里面 实现复用
[leetcode array -- sorting + rolling division maximum common divisor] 6122. The minimum number of deletions that make the array divisible
网络基础原理概述
还在写增删改查代码?直接一键生成
UE4 钥匙开门
[leetcode string -- string subscript sorting] 6121. Query the number with the smallest k after cutting the number
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
解析参与机器人教育竞赛的热潮
随机推荐
复杂网络建模(网络上的传播现象 )
LeetCode 每日一题——814. 二叉树剪枝
UE4 用灰度图构建地形
二叉树OJ题,IO题
[leetcode weekly race -- hash table number pairs] 6164. Maximum sum of digit and equal number pairs
Mecol Studio - the third assignment of harmonyos application development training
Random forest learning notes
arm64环境下,golang的第三方库hajimehoshi/oto依赖alsa-lib和cgo的解决方案
源启数字化:既有模式,还是开源创新?|砺夏行动
PHP QR code decoding qrreader class | QR code image to string
Sequence traversal BFS (breadth first)
UE4 通过按键升降电梯
Leetcode daily question 814. Binary tree pruning
Complex network modeling (propagation phenomenon on the network)
PHP二维码解码QrReader类|二维码图片转字符串
ES6中的一些新特性
UE4 修改默认缓存路径
Analyzing and optimizing robot course system and teaching strategy
正则表达式相关
【vs】如何查看线程阻塞在哪里