concat

dragon.vm.tensorflow.concat(
  values,
  axis,
  name='concat'
)[source]

Concatenate the values along the given axis.

All dimensions except the axis should be same:

x1 = tf.ones(shape=(2, 3))
x2 = tf.zeros(shape=(2, 4))
y = tf.concat([x1, x2], axis=1)  # Ok
z = tf.concat([x1, x2], axis=0)  # Wrong

The axis can be negative representing the last-k axis:

y = tf.concat([x1, x2], axis=1)
z = tf.concat([x1, x2], axis=-1)  # z == y
Parameters:
  • values (Sequence[dragon.Tensor]) – The input tensors.
  • axis (int) – The axis to concatenate
  • name (str, optional) – The operation name.
Returns:

dragon.Tensor – The output tensor.