LayerGraphContract
Layers · AiDotNet.NeuralNetworks.Layers
Declares a non-sequential graph boundary inside an iterator-based layer factory. Plain
yield return remains the beginner-friendly sequential default; composite factories use
these markers where a layer starts an independent external or derived branch.
How It Works
The methods return the exact same layer instance and add no runtime wrapper. Their purpose is to make the topology visible to the input-contract generator, which can then validate every real sequential edge without inventing an edge between two independently registered components.
Methods
| Method | Summary |
|---|---|
TLayer FromDerivedInput(TLayer layer, string sourcePort) |
Declares that layer consumes a tensor derived from a named earlier input, such as position IDs derived from token IDs. |
TLayer FromExternalInput(TLayer layer) |
Declares that layer consumes a separate caller input. |