通过输入张量句柄来获取dtype
类型的张量。
用法
tf.compat.v1.get_session_tensor(
handle, dtype, name=None
)
参数
-
handle
持久张量句柄的字符串表示形式。 -
dtype
输出张量的类型。 -
name
返回张量的可选名称前缀。
返回
- 一对张量。第一个是用于输入张量句柄的占位符,第二个是由张量句柄键入的会话状态中的张量。
这是实验性的,可能会发生变化。
从张量句柄中获取张量的值。张量在先前的run() 中生成并存储在会话的状态中。
例子:
c = tf.multiply(a, b)
h = tf.compat.v1.get_session_handle(c)
h = sess.run(h)
p, a = tf.compat.v1.get_session_tensor(h.handle, tf.float32)
b = tf.multiply(a, 10)
c = sess.run(b, feed_dict={p:h.handle})
相关用法
- Python tf.compat.v1.get_session_handle用法及代码示例
- Python tf.compat.v1.get_variable_scope用法及代码示例
- Python tf.compat.v1.get_local_variable用法及代码示例
- Python tf.compat.v1.get_variable用法及代码示例
- Python tf.compat.v1.gfile.Copy用法及代码示例
- Python tf.compat.v1.gather用法及代码示例
- Python tf.compat.v1.gfile.Exists用法及代码示例
- Python tf.compat.v1.gradients用法及代码示例
- Python tf.compat.v1.gfile.FastGFile.close用法及代码示例
- Python tf.compat.v1.gather_nd用法及代码示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代码示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代码示例
- Python tf.compat.v1.data.TFRecordDataset.interleave用法及代码示例
- Python tf.compat.v1.distributions.Bernoulli.cross_entropy用法及代码示例
- Python tf.compat.v1.Variable.eval用法及代码示例
- Python tf.compat.v1.train.FtrlOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.layers.conv3d用法及代码示例
- Python tf.compat.v1.strings.length用法及代码示例
- Python tf.compat.v1.data.Dataset.snapshot用法及代码示例
- Python tf.compat.v1.data.experimental.SqlDataset.reduce用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.get_session_tensor。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。