tf.keras.layers.RepeatVector
Stay organized with collections
Save and categorize content based on your preferences.
Repeats the input n times.
Inherits From: Layer
tf.keras.layers.RepeatVector(
n, **kwargs
)
Example:
model = Sequential()
model.add(Dense(32, input_dim=32))
# now: model.output_shape == (None, 32)
# note: `None` is the batch dimension
model.add(RepeatVector(3))
# now: model.output_shape == (None, 3, 32)
Arguments |
n
|
Integer, repetition factor.
|
2D tensor of shape (num_samples, features)
.
Output shape:
3D tensor of shape (num_samples, n, features)
.
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.layers.RepeatVector\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/layers/RepeatVector) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/layers/core.py#L608-L648) |\n\nRepeats the input n times.\n\nInherits From: [`Layer`](../../../tf/keras/layers/Layer)\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.layers.RepeatVector`](/api_docs/python/tf/keras/layers/RepeatVector), \\`tf.compat.v2.keras.layers.RepeatVector\\`\n\n\u003cbr /\u003e\n\n tf.keras.layers.RepeatVector(\n n, **kwargs\n )\n\n#### Example:\n\n model = Sequential()\n model.add(Dense(32, input_dim=32))\n # now: model.output_shape == (None, 32)\n # note: `None` is the batch dimension\n\n model.add(RepeatVector(3))\n # now: model.output_shape == (None, 3, 32)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-----|-----------------------------|\n| `n` | Integer, repetition factor. |\n\n\u003cbr /\u003e\n\n#### Input shape:\n\n2D tensor of shape `(num_samples, features)`.\n\n#### Output shape:\n\n3D tensor of shape `(num_samples, n, features)`."]]