Skip to content

Conversation

@hwnam831
Copy link

@hwnam831 hwnam831 commented Jan 26, 2026

Pytorch NLLLoss had a conversion error issue to StableHLO.
The conversion was blocked by error: Assertion isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed. because torch-mlir's NllLoss decomposition creates torch.prim.NumToTensor.Scalar %int0 : !torch.int -> !torch.vtensor<*,si64>.
This is problematic because StableHLO lowering doesn't know how to handle a tensor !torch.vtensor<*,si64> of empty shape.
Fixed by modifying the code to produce !torch.vtensor<[1],si64>.

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.

1 participant