[ONNX] Handle dynamic input axes for prim_ConstantChunk (#48176)
Summary:
When converting a model that uses `torch.chunk`, it does not work when we have a dynamic input axes, because `Split` split attr is static for opset 11. Therefore, we convert it using `Slice` (support opset 11+). This PR also handles the cases that the input axes cannot be divided by the number of outputs. Pytorch works a way that fit the first (n-1) outputs for the same dim, and remaining for the last one. Added UT for it.
The existing code on `sequence` `split` cannot be leveraged here, because `start`, `end` of `Slice` are static there, but dynamic here.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48176
Reviewed By: bdhirsh
Differential Revision: D25274862
Pulled By: bzinodev
fbshipit-source-id: 7d213a7605ad128aca133c057d6dd86c65cc6de9