Concatenates a list of tf.Tensors along a given axis.
tf.Tensor
The tensors ranks and types must match, and their sizes must match in all dimensions except axis.
axis
Also available are stricter rank-specific methods that assert that tensors are of the given rank:
tensors
tf.concat1d
tf.concat2d
tf.concat3d
tf.concat4d
Except tf.concat1d (which does not have axis param), all methods have same signature as this method.
const a = tf.tensor1d([1, 2]);const b = tf.tensor1d([3, 4]);a.concat(b).print(); // or a.concat(b) Copy
const a = tf.tensor1d([1, 2]);const b = tf.tensor1d([3, 4]);a.concat(b).print(); // or a.concat(b)
const a = tf.tensor1d([1, 2]);const b = tf.tensor1d([3, 4]);const c = tf.tensor1d([5, 6]);tf.concat([a, b, c]).print(); Copy
const a = tf.tensor1d([1, 2]);const b = tf.tensor1d([3, 4]);const c = tf.tensor1d([5, 6]);tf.concat([a, b, c]).print();
const a = tf.tensor2d([[1, 2], [10, 20]]);const b = tf.tensor2d([[3, 4], [30, 40]]);const axis = 1;tf.concat([a, b], axis).print(); Copy
const a = tf.tensor2d([[1, 2], [10, 20]]);const b = tf.tensor2d([[3, 4], [30, 40]]);const axis = 1;tf.concat([a, b], axis).print();
A list of tensors to concatenate.
Optional
The axis to concatenate along. Defaults to 0 (the first dim).
Concatenates a list of
tf.Tensor
s along a given axis.The tensors ranks and types must match, and their sizes must match in all dimensions except
axis
.Also available are stricter rank-specific methods that assert that
tensors
are of the given rank:tf.concat1d
tf.concat2d
tf.concat3d
tf.concat4d
Except
tf.concat1d
(which does not have axis param), all methods have same signature as this method.