tf.contrib.layers.repeat
Stay organized with collections
Save and categorize content based on your preferences.
Applies the same layer with the same arguments repeatedly.
tf.contrib.layers.repeat(
inputs, repetitions, layer, *args, **kwargs
)
y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1')
# It is equivalent to:
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1')
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_2')
y = conv2d(x, 64, [3, 3], scope='conv1/conv1_3')
If the scope
argument is not given in kwargs
, it is set to
layer.__name__
, or layer.func.__name__
(for functools.partial
objects). If neither __name__
nor func.__name__
is available, the
layers are called with scope='stack'
.
Args |
inputs
|
A Tensor suitable for layer.
|
repetitions
|
Int, number of repetitions.
|
layer
|
A layer with arguments (inputs, *args, **kwargs)
|
*args
|
Extra args for the layer.
|
**kwargs
|
Extra kwargs for the layer.
|
Returns |
A tensor result of applying the layer, repetitions times.
|
Raises |
ValueError
|
If the op is unknown or wrong.
|
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.contrib.layers.repeat\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/layers/python/layers/layers.py#L2577-L2620) |\n\nApplies the same layer with the same arguments repeatedly. \n\n tf.contrib.layers.repeat(\n inputs, repetitions, layer, *args, **kwargs\n )\n\n y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1')\n # It is equivalent to:\n\n x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1')\n x = conv2d(x, 64, [3, 3], scope='conv1/conv1_2')\n y = conv2d(x, 64, [3, 3], scope='conv1/conv1_3')\n\nIf the `scope` argument is not given in `kwargs`, it is set to\n`layer.__name__`, or `layer.func.__name__` (for `functools.partial`\nobjects). If neither `__name__` nor `func.__name__` is available, the\nlayers are called with `scope='stack'`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|----------------------------------------------------|\n| `inputs` | A `Tensor` suitable for layer. |\n| `repetitions` | Int, number of repetitions. |\n| `layer` | A layer with arguments `(inputs, *args, **kwargs)` |\n| `*args` | Extra args for the layer. |\n| `**kwargs` | Extra kwargs for the layer. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor result of applying the layer, repetitions times. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|--------------------------------|\n| `ValueError` | If the op is unknown or wrong. |\n\n\u003cbr /\u003e"]]