TensorValidator

Helpers & Utilities · AiDotNet.Validation

Provides validation methods for tensors and neural network operations.

Methods

Method Summary
void ValidateForwardPassPerformed(Tensor<T> lastInput, string componentName, string componentType, string operation) Validates that a forward pass has been performed before a dependent operation.
void ValidateForwardPassPerformedForLayer(Tensor<T> lastInput, string layerName, string layerType) Validates that a forward pass has been performed before a backward pass in a layer.
void ValidateRank(Tensor<T> tensor, int expectedRank, string component, string operation) Validates that a tensor has the expected rank (number of dimensions).
void ValidateShape(Tensor<T> tensor, int[] expectedShape, string component, string operation) Validates that a tensor’s shape matches the expected shape.
void ValidateShapesMatch(Tensor<T> tensor1, Tensor<T> tensor2, string component, string operation) Validates that two tensors have the same shape.