You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Map aten bitwise operators to existing ONNX ones #5497
Currently the aten bitwise operators are not supported in ONNX as listed here. However, as far as I can tell these operators are pretty straightforward (see CPU and CUDA implementations) so it should be possible to map them to existing ONNX bitwise operators.
In particular:
aten::bitwise_and -> BitwiseAnd
aten::bitwise_or -> BitwiseOr
aten::bitwise_not -> BitwiseNot
aten::bitwise_xor -> BitwiseXor
aten::left_shift -> BitShift
aten::right_shift -> BitShift
As a workaround until these ops are available, it also seems to be possible to do the mapping at export time.
Activity
justinchuby commentedon Aug 11, 2023
Thanks for reporting the issue. I would open the same issue on the PyTorch as this concerns the PyTorch API. Contributions would be appreciated!
justinchuby commentedon Aug 11, 2023
At the same time, you may find implementations at https://github.com/microsoft/onnxscript/blob/677b07619fc1da1ec1844886019e3fcb6a06f32e/onnxscript/function_libs/torch_lib/ops/core.py#L1023
leandro-gracia-gil commentedon Aug 11, 2023
Thanks for pointing out the implementation. I wonder why pyTorch was failing to export it then, even when using recent ONNX opset versions.
justinchuby commentedon Aug 11, 2023
The implementation is for the new PyTorch exporter: torch.onnx.dynamo_export. You may experiment with it using the latest torch nightly build.
Add BitShift-28 with signed integer type support (#8270)