ScalarKernelAttribute
Attributes · AiDotNet.Attributes
Marks a member whose element-by-element tensor access is deliberate, exempting it from the ADNELEM001/ADNELEM002 element-wise gate.
Inheritance: Attribute → ScalarKernelAttribute
For Beginners
put this on a method only when reading tensor values one at a time is intended, and
say why in Reason.
How It Works
The gate flags a Tensor<T>, Vector<T> or Matrix<T> indexer, or a per-element
INumericOperations<T> call, inside a loop: work an engine op or a span loop does many times faster. A
member that must stay scalar, such as a reference implementation a test compares against or a loop over a handful
of elements, says so here with the reason.
Constructors
| Constructor | Summary |
|---|---|
ScalarKernelAttribute(string reason) |
Creates the exemption. |
Properties
| Property | Summary |
|---|---|
string Reason { get; } |
Why this member’s per-element access is intended. |