Skip to content

Fix out-of-bounds error#1075

Open
apsonawane wants to merge 1 commit into
mainfrom
asonawane/icm-raggedtensortosparse
Open

Fix out-of-bounds error#1075
apsonawane wants to merge 1 commit into
mainfrom
asonawane/icm-raggedtensortosparse

Conversation

@apsonawane

Copy link
Copy Markdown
Contributor

This pull request adds input validation to the RaggedTensorToSparse operator to ensure the row-splits tensor is well-formed. These checks help catch malformed inputs early and improve error messaging.

Input validation improvements:

  • Added a check to ensure the row-splits tensor is not empty, starts at zero, and is monotonic non-decreasing, with clear error messages for each case in op_ragged_tensor.cc.

Copilot AI review requested due to automatic review settings June 10, 2026 19:23
@apsonawane apsonawane requested a review from a team as a code owner June 10, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request hardens the RaggedTensorToSparse custom operator by validating the row-splits (nested splits) input before it is used to compute output shapes and index buffers, preventing invalid shapes/indices and catching malformed inputs earlier.

Changes:

  • Added a guard for an empty row-splits tensor (prevents p_n_elements[-1] access when the input has 0 elements).
  • Added validation that row-splits starts at 0.
  • Added validation that row-splits is monotonic non-decreasing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@apsonawane apsonawane enabled auto-merge (squash) June 11, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants