I’m using stablehloConvertToLinalg, and I noticed that stablehlo.reshape gets decomposed into tensor.collapse_shape and tensor.expand_shape.
However, I also see that the tensor dialect has a tensor.reshape operation, which seems to have the same semantics.
I’m a bit confused — why not lower stablehlo.reshape directly to tensor.reshape? Is there a specific reason for choosing collapse_shape / expand_shape instead?
https://github.com/openxla/stablehlo/blob/main/stablehlo/conversions/linalg/transforms/StablehloLegalizeToLinalg.cpp#L1088