Commit 8d98094
authored
[torchlib] Fix scatter reduce on error cases (#2287)
Fix three errors
```pytb
value = ir.tensor([np.iinfo(dtype.numpy()).min], dtype=dtype)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/_core/getlimits.py", line 706, in __init__
raise ValueError("Invalid integer data type %r." % (self.kind,))
ValueError: Invalid integer data type 'b'.
```
```pytb
Traceback (most recent call last):
File "/Users/runner/work/torch-onnx-op-matrix/torch-onnx-op-matrix/op_matrix/onnx_dynamo_op_survey.py", line 54, in check_single_op
onnx.checker.check_model(onnx_model, full_check=True) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/onnx/checker.py", line 180, in check_model
C.check_model(
onnx.onnx_cpp2py_export.checker.ValidationError: Mismatched attribute type in 'node_ConstantOfShape_1 : value'. Expected: 'TENSOR', actual: 'INT'
==> Context: Bad node spec for node. Name: node_ConstantOfShape_1 OpType: ConstantOfShape
```
Fix a case for bfloat16 when min should be max.1 parent a0cf581 commit 8d98094
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7627 | 7627 | | |
7628 | 7628 | | |
7629 | 7629 | | |
| 7630 | + | |
| 7631 | + | |
7630 | 7632 | | |
7631 | 7633 | | |
7632 | 7634 | | |
| |||
7638 | 7640 | | |
7639 | 7641 | | |
7640 | 7642 | | |
7641 | | - | |
| 7643 | + | |
| 7644 | + | |
| 7645 | + | |
7642 | 7646 | | |
7643 | 7647 | | |
7644 | 7648 | | |
| |||
7649 | 7653 | | |
7650 | 7654 | | |
7651 | 7655 | | |
7652 | | - | |
| 7656 | + | |
7653 | 7657 | | |
7654 | 7658 | | |
7655 | 7659 | | |
| |||
0 commit comments