將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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
