Skip to main content

Module validation

Module validation 

Source
Expand description

Input Validation Utilities

This module provides comprehensive validation utilities to prevent runtime panics and ensure data integrity across the OCR pipeline.

Functionsยง

validate_batch_size
Validates that tensor batch size is positive.
validate_division
Validates division operands to prevent division by zero.
validate_finite
Validates that a float value is finite (not NaN or infinite).
validate_image_dimensions
Validates image dimensions.
validate_index_bounds
Validates that array index is within bounds.
validate_non_empty
Validates that a collection is not empty.
validate_non_negative
Validates that a value is non-negative (>= 0).
validate_normalization_params
Validates normalization parameters (mean and std).
validate_positive
Validates that a value is positive (> 0).
validate_range
Validates that a value is within a specified range (inclusive).
validate_same_length
Validates that two collections have the same length.
validate_tensor_shape
Validates tensor shape dimensions.