Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions onnxruntime/contrib_ops/cpu/bert/multihead_attention_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ Status CheckPast(const T* past_key, const T* past_value, const T* past_seq_len,
"past_sequence_length tensor must be of one element when past_present_share_buffer is set");
}
past_sequence_length = *((*past_seq_len).template Data<int32_t>());
if (past_sequence_length < 0 || past_sequence_length >= max_sequence_length) {
return ORT_MAKE_STATUS(
ONNXRUNTIME, INVALID_ARGUMENT,
"past_sequence_length must be non-negative and less than max_sequence_length (",
max_sequence_length, "), got ", past_sequence_length);
}
Comment thread
apsonawane marked this conversation as resolved.
}
return Status::OK();
}
Expand Down
Loading