onnxruntime
3a4a93b9 - test(ml): improve LinearRegressor test coverage (#29083)

Commit
16 days ago
test(ml): improve LinearRegressor test coverage (#29083) This pull request adds several comprehensive tests to improve the coverage and robustness of the `LinearRegressor` operator in ONNX Runtime. The new tests cover various input shapes, validation of attributes, and edge cases, ensuring that the operator behaves correctly and fails gracefully when given invalid inputs. **Expanded test coverage for `LinearRegressor`:** * Added tests for 1D input handling, including both valid and undersized coefficients scenarios to verify correct computation and validation failures. * Added a test for zero-batch input to ensure that the operator produces the correct output shape when there are no input samples. * Added a test for missing intercepts to verify that the operator correctly handles the GEMM path without bias. * Added a test for mismatched intercepts size to confirm that intercepts are ignored when their count does not match the number of targets. **Edge case and error handling:** * Added tests for input validation, including detection of coefficients overflow and rejection of unsupported 3D input tensors. **Test infrastructure:** * Included necessary headers `<cstdint>` and `<limits>` to support new test cases involving large integer values and overflow checks.
Author
Parents
Loading