将N rank-R 张量列表打包到一个rank-(R+1) 张量中。
用法
tf.raw_ops.Pack(
values, axis=0, name=None
)参数
-
values至少 1 个具有相同类型的Tensor对象的列表。必须具有相同的形状和类型。 -
axis可选的int。默认为0。包装的尺寸。负值环绕,因此有效范围是[-(R+1), R+1)。 -
name操作的名称(可选)。
返回
-
一个
Tensor。具有与values相同的类型。
通过沿 axis 维度打包它们,将 values 中的 N 张量打包到比 values 中的每个张量高一级的张量中。给定一个形状为 (A, B, C) 的张量列表;
如果 axis == 0 那么 output 张量将具有形状 (N, A, B, C) 。如果 axis == 1 那么 output 张量将具有形状 (A, N, B, C) 。等等。
例如:
# 'x' is [1, 4]
# 'y' is [2, 5]
# 'z' is [3, 6]
pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
这与 unpack 相反。
相关用法
- Python tf.raw_ops.ParallelConcat用法及代码示例
- Python tf.raw_ops.Pad用法及代码示例
- Python tf.raw_ops.ParseSequenceExampleV2用法及代码示例
- Python tf.raw_ops.ParallelDynamicStitch用法及代码示例
- Python tf.raw_ops.PadV2用法及代码示例
- Python tf.raw_ops.Pow用法及代码示例
- Python tf.raw_ops.TPUReplicatedInput用法及代码示例
- Python tf.raw_ops.Bitcast用法及代码示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代码示例
- Python tf.raw_ops.BatchMatMul用法及代码示例
- Python tf.raw_ops.OneHot用法及代码示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代码示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代码示例
- Python tf.raw_ops.GatherV2用法及代码示例
- Python tf.raw_ops.Expm1用法及代码示例
- Python tf.raw_ops.BitwiseAnd用法及代码示例
- Python tf.raw_ops.UniqueWithCounts用法及代码示例
- Python tf.raw_ops.DecodeGif用法及代码示例
- Python tf.raw_ops.Size用法及代码示例
- Python tf.raw_ops.ScatterUpdate用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.Pack。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
