# LinearRule

``` python
LinearRule()
```

Rule for `nn.Linear` on inputs `[N, D]` or `[N, *positions, D]`.

`T` is the product of the position sizes (1 for `[N, D]`) and `G` is 1.

## Methods

| Name | Description |
|----|----|
| [check](#hessiankit.LinearRule.check) | Refuse a module that isn’t `nn.Linear` and inputs with fewer than 2 dimensions. |
| [grads](#hessiankit.LinearRule.grads) | The output gradient as `[N, T, D_out]`. |
| [inputs](#hessiankit.LinearRule.inputs) | The input as `[N, T, 1, D_in]`. |

### check

``` python
LinearRule.check(module, x, name, /)
```

Refuse a module that isn’t `nn.Linear` and inputs with fewer than 2 dimensions.

### grads

``` python
LinearRule.grads(module, g, /)
```

The output gradient as `[N, T, D_out]`.

### inputs

``` python
LinearRule.inputs(module, x, /)
```

The input as `[N, T, 1, D_in]`.
