input
Creates an input layer that defines the entry point for data into the network.
Parameters
inputSize
The number of input features/dimensions
id
Optional identifier for the layer (auto-generated if empty)
requiresGrad
Whether the input requires gradients (default: false)
open override fun input(inputShape: IntArray, id: String = "", requiresGrad: Boolean = false)(source)
Declares a multi-dimensional input shape (per-sample, batch dimension excluded).
Required when downstream spatial layers (conv, pool, upsample) need to feed a flatten() ->dense() chain — without this, the DSL cannot know the flattened feature count ahead of time.
Example: input(intArrayOf(1, 28, 28)) declares one-channel 28x28 images.
Parameters
inputShape
Per-sample shape (e.g. [channels, height, width])
id
Optional identifier for the layer
requiresGrad
Whether the input requires gradients (default: false)