Add boundary checks for input validation
Merged
AP
5mo ago+6+6+0123456789-0-0-0123456789
This pull request introduces an important input validation in the multihead_attention_helper.h file to ensure the integrity of the past_sequence_length parameter. The main change is an additional check that validates the value of past_sequence_length to prevent invalid or out-of-bounds values.
Input validation improvements:
- Added a check to ensure that
past_sequence_lengthis non-negative and less thanmax_sequence_length, returning an error status if the condition is not met inStatus CheckPastinonnxruntime/contrib_ops/cpu/bert/multihead_attention_helper.h.