# tfl.premade_lib.build_linear_layer

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/premade_lib.py#L482-L532) |

Creates a [`tfl.layers.Linear`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/Linear) layer initialized to be an average.

#### View aliases


**Main aliases**

[`tfl.premade.premade_lib.build_linear_layer`](https://www.tensorflow.org/lattice/api_docs/python/tfl/premade_lib/build_linear_layer)

<br />

    tfl.premade_lib.build_linear_layer(
        linear_input,
        feature_configs,
        model_config,
        weighted_average,
        submodel_index,
        dtype
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `linear_input` | Input to the linear layer. |
| `feature_configs` | A list of [`tfl.configs.FeatureConfig`](https://www.tensorflow.org/lattice/api_docs/python/tfl/configs/FeatureConfig) instances that specify configurations for each feature. |
| `model_config` | Model configuration object describing model architecture. Should be one of the model configs in [`tfl.configs`](https://www.tensorflow.org/lattice/api_docs/python/tfl/configs). |
| `weighted_average` | If the linear coefficients should be positive and sum up to one. |
| `submodel_index` | Corresponding index into submodels. |
| `dtype` | dtype |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A [`tfl.layers.Linear`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/Linear) instance. ||

<br />