<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/modeling/layers/nn_layers.py#L406-L456) |

Scales the input by a trainable scalar weight.

    tfm.vision.layers.Scale(
        initializer: tf_keras.initializers.Initializer = 'ones',
        regularizer: Optional[tf_keras.regularizers.Regularizer] = None,
        **kwargs
    )

This is useful for applying ReZero to layers, which improves convergence
speed. This implements the paper:
ReZero is All You Need: Fast Convergence at Large Depth.
(<https://arxiv.org/pdf/2003.04887.pdf>).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `initializer` | A `str` of initializer for the scalar weight. |
| `regularizer` | A `tf_keras.regularizers.Regularizer` for the scalar weight. |
| `**kwargs` | Additional keyword arguments to be passed to this layer. |

<br />

## Methods

### `call`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/modeling/layers/nn_layers.py#L453-L456)

    call(
        inputs
    )

Calls the layer with the given inputs.