pytorch
b2f34055 - [ONNX] Supports scatter_add with different static shape of src and index (#89787)

Commit
2 years ago
[ONNX] Supports scatter_add with different static shape of src and index (#89787) Prior to this change, the converter doesn't support `scatter_add` with different shape of `src` and `index`, while [it's claimed to be supported by PyTorch](https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_add_.html#torch.Tensor.scatter_add_) in a way that scatter shape would be accommodated to index shape. This PR adds `onnx::Slice` to adjust the shape of `src` when a static and mismatched shape is found. However, if both of the shape (src and index) is set to dynamic, they are expected to be the same shape from ONNX due to the spec. More ScatterElements details on https://github.com/onnx/onnx/issues/4672 Pull Request resolved: https://github.com/pytorch/pytorch/pull/89787 Approved by: https://github.com/BowenBao
Author
Committer
Parents
Loading