InputContractTensorFactory

Helpers & Utilities · AiDotNet.NeuralNetworks

Contract-driven tensor creation for generated tests, examples and custom tooling. It is the inverse of InputContractValidator: every generated value is legal by construction.

Methods

Method Summary
IReadOnlyDictionary<string, Tensor<T>> CreateValidInputs(BoundInputContract contract, Random random, bool includeOptional) Creates every caller-supplied port in a selected named-input variant.
Tensor<T> CreateInvalid(int[] shape, LayerInputDomain domain)
Tensor<T> CreateNearby(Tensor<T> input, LayerInputDomain domain, double epsilon)
Tensor<T> CreateValid(BoundInputContract contract, Random random)
Tensor<T> CreateValid(int[] shape, LayerInputDomain domain, Random random)