[NNC] Skip buildShapeExpressions if ConstantChunk input shapes are unknown (#82698)
buildShapeExpressions skips shape building for nodes if their inputs are
unknown.
Before prim::ConstantChunk ops were not skipped if their inputs were
unknown, which caused issues for graphs like:
```
graph(%x.1 : Float(4, 4, strides=[4, 1], requires_grad=0, device=cpu),
%y.1 : Float(4, 4, strides=[4, 1], requires_grad=0, device=cpu)):
%2 : Long(requires_grad=0, device=cpu) = prim::Constant[value={4}]() # skip, constants unsupported
%3 : int = prim::Constant[value=1]() # skip, constants unsupported
%4 : Float(4, 4, strides=[4, 1], requires_grad=0, device=cpu) = aten::add(%x.1, %y.1, %3) # calculate
%5 : Float(4, 4, strides=[4, 1], requires_grad=0, device=cpu) = aten::add(%4, %2, %3) # skip, because %2 doesn't have shapes defined in the map
%6 : Float(4, 2, strides=[4, 1], requires_grad=0, device=cpu), %7 : Float(4, 2, strides=[4, 1], requires_grad=0, device=cpu) = prim::ConstantChunk[chunks=2, dim=1](%5) # <-- FAIL because %5 isn't defined
%8 : Float(4, 2, strides=[2, 1], requires_grad=0, device=cpu) = aten::mul(%6, %7) # ...
```
(buildShapeExpressions would fail with std::out_of_range because the value was not found in the shapes map)
This moves the skip logic before the prim::ConstantChunk case to avoid this issue.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82698
Approved by: https://github.com/eellison