# core.PerInputCov

``` python
core.PerInputCov(blocks, event_shape=static())
```

Dense `[N, E, E]` blocks, one per input. Fine for classifiers with small C.

## Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| blocks | Tensor | The blocks, `[N, E, E]`. | *required* |
| event_shape | tuple\[int, …\] | The shape of one input’s outputs; $E$ is its product. | `static()` |

## Methods

| Name | Description |
|----|----|
| [diagonal](#laplacekit.core.PerInputCov.diagonal) | The diagonals of the blocks, `[N, *event_shape]`. |
| [per_input](#laplacekit.core.PerInputCov.per_input) | `blocks`. |
| [sample](#laplacekit.core.PerInputCov.sample) | `n_samples` zero-mean draws through a symmetric square root of each block. |
| [scaled](#laplacekit.core.PerInputCov.scaled) | The blocks times $s$. |

### diagonal

``` python
core.PerInputCov.diagonal()
```

The diagonals of the blocks, `[N, *event_shape]`.

#### Returns

| Name | Type   | Description                    |
|------|--------|--------------------------------|
|      | Tensor | A tensor shaped like the mean. |

### per_input

``` python
core.PerInputCov.per_input()
```

`blocks`.

#### Returns

| Name | Type   | Description              |
|------|--------|--------------------------|
|      | Tensor | The blocks, `[N, E, E]`. |

### sample

``` python
core.PerInputCov.sample(n_samples, /, *, generator=None)
```

`n_samples` zero-mean draws through a symmetric square root of each block.

The draws are independent across inputs. Negative eigenvalues of a block count as zero.

#### Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| n_samples | int | Number of draws. | *required* |
| generator | torch.Generator \| None | The generator to draw with, on any device: the draws move to the blocks’. `None` means torch’s global RNG. | `None` |

#### Returns

| Name | Type   | Description                            |
|------|--------|----------------------------------------|
|      | Tensor | The draws, `[n_samples, *mean.shape]`. |

### scaled

``` python
core.PerInputCov.scaled(s, /)
```

The blocks times $s$.

#### Parameters

| Name | Type   | Description                           | Default    |
|------|--------|---------------------------------------|------------|
| s    | Tensor | The factor $s \ge 0$, a 0-dim tensor. | *required* |

#### Returns

| Name | Type | Description                    |
|------|------|--------------------------------|
|      | Self | A covariance of the same type. |
