Skip to content

Improve error handling and message of lowering helper functions.#9722

Merged
ysiraichi merged 3 commits into
masterfrom
ysiraichi/better-error-lower-helpers
Dec 3, 2025
Merged

Improve error handling and message of lowering helper functions.#9722
ysiraichi merged 3 commits into
masterfrom
ysiraichi/better-error-lower-helpers

Conversation

@ysiraichi

@ysiraichi ysiraichi commented Nov 26, 2025

Copy link
Copy Markdown
Collaborator

This PR improves the error handling and error message of some lowering helper functions found in helpers.{h,cpp} C++ files.

Key Changes:

  • Created Safe* versions of the functions:
    • Flatten
    • DynamicReshape
    • GetDynamicReshapeInfo
  • Created CheckAtMostOneDynamicDimension() function, a version of GetDynamicDimension with improved error handling and messages
  • Removed the shape parameter from SafeFlatten()
    • It should be called separately
  • Add missing includes (IWYU ref)

Comment thread torch_xla/csrc/helpers.h Outdated
Comment thread torch_xla/csrc/helpers.cpp Outdated
Comment thread torch_xla/csrc/helpers.cpp Outdated
Comment thread torch_xla/csrc/helpers.cpp Outdated
Comment thread torch_xla/csrc/helpers.cpp Outdated
@ysiraichi ysiraichi force-pushed the ysiraichi/better-error-lower-helpers branch from e310dc3 to f5b654b Compare December 3, 2025 12:49
@ysiraichi ysiraichi force-pushed the ysiraichi/better-error-lower-helpers branch from f5b654b to 1528223 Compare December 3, 2025 12:51
@ysiraichi ysiraichi merged commit be2e345 into master Dec 3, 2025
20 checks passed
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