Skip to content

Conversation

@Lunderberg
Copy link
Contributor

Prior to this commit, the error message produced when validating R.call_tir_inplace included the shape of the argument that will be mutated in-place. This correctly caught and raised an error when the argument is a tensor with known shape that is incompatible with the output tensor's shape. However, this same error message could be also be reached if the input does not have TensorStructInfo at all, which would trigger a segfault.

This commit updates the validation to print the argument's StructInfo directly, rather than a field from the struct info. This correctly raises an error for the cases where the argument is not a tensor, or is a tensor with unknown dimensionality, while still printing the explicit shape of the mismatched tensor when avalable.

Prior to this commit, the error message produced when validating
`R.call_tir_inplace` included the shape of the argument that will be
mutated in-place.  This correctly caught and raised an error when the argument is a
tensor with known shape that is incompatible with the output tensor's
shape.  However, this same error message could be also be reached if
the input does not have `TensorStructInfo` at all, which would trigger
a segfault.

This commit updates the validation to print the argument's
`StructInfo` directly, rather than a field from the struct info.  This
correctly raises an error for the cases where the argument is not a
tensor, or is a tensor with unknown dimensionality, while still
printing the explicit shape of the mismatched tensor when avalable.
@tqchen tqchen merged commit 591cf1e into apache:main Aug 6, 2024
@Lunderberg Lunderberg deleted the relax_avoid_exception_in_call_tir_inplace_normalization branch August 6, 2024 14:11
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