tf.keras.backend.concatenate
Stay organized with collections
Save and categorize content based on your preferences.
Concatenates a list of tensors alongside the specified axis.
tf.keras.backend.concatenate(
tensors, axis=-1
)
Arguments |
tensors
|
list of tensors to concatenate.
|
axis
|
concatenation axis.
|
Example:
a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
b = tf.constant([[10, 20, 30], [40, 50, 60], [70, 80, 90]])
tf.keras.backend.concatenate((a, b), axis=-1)
<tf.Tensor: id=14, shape=(3, 6), dtype=int32, numpy=
array([[ 1, 2, 3, 10, 20, 30],
[ 4, 5, 6, 40, 50, 60],
[ 7, 8, 9, 70, 80, 90]], dtype=int32)>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.concatenate\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/backend/concatenate) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L2562-L2594) |\n\nConcatenates a list of tensors alongside the specified axis.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.concatenate`](/api_docs/python/tf/keras/backend/concatenate), \\`tf.compat.v2.keras.backend.concatenate\\`\n\n\u003cbr /\u003e\n\n tf.keras.backend.concatenate(\n tensors, axis=-1\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-----------|---------------------------------|\n| `tensors` | list of tensors to concatenate. |\n| `axis` | concatenation axis. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor. ||\n\n\u003cbr /\u003e\n\n#### Example:\n\n a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n b = tf.constant([[10, 20, 30], [40, 50, 60], [70, 80, 90]])\n tf.keras.backend.concatenate((a, b), axis=-1)\n \u003ctf.Tensor: id=14, shape=(3, 6), dtype=int32, numpy=\n array([[ 1, 2, 3, 10, 20, 30],\n [ 4, 5, 6, 40, 50, 60],\n [ 7, 8, 9, 70, 80, 90]], dtype=int32)\u003e"]]