public class Flatten<T extends AbstractFloat = Float> extends Layer<T>
Flattens sample axes while preserving the leading batch axis. The current NDArray reshape contract produces a contiguous copy of the batch, not a shared view. No full-dataset flattening is performed during fit.
flatten = Flatten<Float>()
| Modifier and Type | Member | Description |
|---|---|---|
| public override readonly property | displayNamedisplayName as String |
Summary label. |
| public override readonly property | parameterCountparameterCount as ULong |
No trainable parameters. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | buildShape | Computes the product of the positive sample axes with overflow checking. |
| public override | differentiatedifferentiate(inputs as NDArray<T>, upstream as NDArray<T>) as LayerGradients<T> |
Restores the original sample axes in the gradient. |
| public override | forward | Copies a batch to [samples, product(sample axes)], leaving inputs unchanged. |
| public override | parameter | Rejects parameter access. |