graph_weather icon indicating copy to clipboard operation
graph_weather copied to clipboard

Fail fast on invalid model input shapes with centralized validation

Open aryarathoree opened this issue 10 months ago • 0 comments

Description

This PR adds centralized input validation for model forward() inputs to ensure that tensors follow the expected [batch, nodes, features] shape.

Previously, invalid input shapes could lead to cryptic PyTorch runtime errors or failures deeper in the computation graph. With this change, models fail fast with clear and informative error messages at the API boundary.

Unit tests are included to verify the validation logic without pulling in heavy optional dependencies.

Fixes #190

How Has This Been Tested?

  • Added focused unit tests for the input validation logic.
  • Ran the new tests locally using:
    pytest tests/test_input_validation.py
    
    

aryarathoree avatar Jan 05 '26 17:01 aryarathoree