tf.keras.layers.RepeatVector
Stay organized with collections
Save and categorize content based on your preferences.
Repeats the input n times.
Inherits From: Layer
, Module
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. Some content is licensed under the numpy license.
Last updated 2021-02-18 UTC.
[null,null,["Last updated 2021-02-18 UTC."],[],[],null,["# tf.keras.layers.RepeatVector\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/layers/RepeatVector) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/keras/layers/core.py#L713-L753) |\n\nRepeats the input n times.\n\nInherits From: [`Layer`](../../../tf/keras/layers/Layer), [`Module`](../../../tf/Module)\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`](https://www.tensorflow.org/api_docs/python/tf/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)`."]]