例如:x = tf.constant([1, 4])y = tf.constant([2, 5])z = tf.constant([3, 6])tf.stack([x, y, z]) # [[1, 4...], [2, 5], [3, 6]] (Pack along first dim.)tf.stack([x, y, z], axis=1) # [[1, 2, 3], [4, 5, 6]]这是unstack...相当于numpy的:tf.stack([x, y, z]) = np.stack([x, y, z]) 参数:value: 具有相同形状和类型的张量对象列表。axis: 一个整型数。要堆叠的轴。...默认为第一个维度。负值环绕,所以有效范围是[-(R+1), R+1)。name: 此操作的名称(可选)。返回值:output: 与值类型相同的叠加张量。...返回值:ValueError: If axis is out of the range [-(R+1), R+1).原链接: https://tensorflow.google.cn/api_docs