-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported left operand for type * in onnxscript and opset15 #18200
Comments
@JukkaL @msullivan @ilevkivskyi Hi everyone, could either of you please help take a look at this issue? I will really appreciate your inputs. |
This is likely an issue with the third-party onnx library you are using; it may not expose any typing information, or its typing information may be incorrect. |
@JelleZijlstra Thank you for your quick response. Does mypy support |
I know nothing about onnx and I don't have time to familiarize myself with it. But mypy doesn't "support" individual third-party packages; these packages should expose typing information using the standards set by the Python type system, and mypy will read that information. |
Moved to onnx/onnx#6563 |
Bug Report
I tried to convert a Python function to onnx Model using onnxscript (the @script() decorator). However, I keep getting weird error types from running
python run mypy [Python-file-name]
, includingoperator
,no-any-return
andno-untyped call.
When I run the code withoutmypy
, it worked perfectly (the result was accurate).(A clear and concise description of what the bug is.)
To Reproduce
Expected Behavior
Actual Behavior
error: Unsupported left operand type for * ("BFLOAT16") [operator]
error: Unsupported left operand type for * ("BOOL") [operator]
error: Unsupported left operand type for * ("COMPLEX128") [operator]
error: Unsupported left operand type for * ("COMPLEX64") [operator]
error: Unsupported left operand type for * ("DOUBLE") [operator]
error: Unsupported left operand type for * ("FLOAT") [operator]
error: Unsupported left operand type for * ("FLOAT16") [operator]
error: Unsupported left operand type for * ("FLOAT8E4M3FN") [operator]
error: Unsupported left operand type for * ("FLOAT8E4M3FNUZ") [operator]
error: Unsupported left operand type for * ("FLOAT8E5M2") [operator]
error: Unsupported left operand type for * ("FLOAT8E5M2FNUZ") [operator]
error: Unsupported left operand type for * ("INT16") [operator]
error: Unsupported left operand type for * ("INT32") [operator]
error: Unsupported left operand type for * ("INT64") [operator]
error: Unsupported left operand type for * ("INT8") [operator]
error: Unsupported left operand type for * ("STRING") [operator]
error: Unsupported left operand type for * ("UINT16") [operator]
error: Unsupported left operand type for * ("UINT32") [operator]
error: Unsupported left operand type for * ("UINT64") [operator]
error: Unsupported left operand type for * ("UINT8") [operator]
note: Left operand is of type "BFLOAT16 | BOOL | COMPLEX128 | COMPLEX64 | DOUBLE | <15 more items>"
error: Unsupported left operand type for * ("BFLOAT16") [operator]
error: Unsupported left operand type for * ("BOOL") [operator]
error: Unsupported left operand type for * ("COMPLEX128") [operator]
error: Unsupported left operand type for * ("COMPLEX64") [operator]
error: Unsupported left operand type for * ("DOUBLE") [operator]
error: Unsupported left operand type for * ("FLOAT") [operator]
error: Unsupported left operand type for * ("FLOAT16") [operator]
error: Unsupported left operand type for * ("FLOAT8E4M3FN") [operator]
error: Unsupported left operand type for * ("FLOAT8E4M3FNUZ") [operator]
error: Unsupported left operand type for * ("FLOAT8E5M2") [operator]
error: Unsupported left operand type for * ("FLOAT8E5M2FNUZ") [operator]
error: Unsupported left operand type for * ("INT16") [operator]
error: Unsupported left operand type for * ("INT32") [operator]
error: Unsupported left operand type for * ("INT64") [operator]
error: Unsupported left operand type for * ("INT8") [operator]
error: Unsupported left operand type for * ("STRING") [operator]
error: Unsupported left operand type for * ("UINT16") [operator]
error: Unsupported left operand type for * ("UINT32") [operator]
error: Unsupported left operand type for * ("UINT64") [operator]
error: Unsupported left operand type for * ("UINT8") [operator]
note: Left operand is of type "BFLOAT16 | BOOL | COMPLEX128 | COMPLEX64 | DOUBLE | <15 more items>"
error: Returning Any from function declared to return "FLOAT" [no-any-return] --- Puzzled by this!!
error: Call to untyped function "to_model_proto" in typed context [no-untyped-call]
Your Environment
mypy.ini
(and other config files):[mypy]
python_version=3.11
platform=linux
show_column_numbers=True
follow_imports=normal
ignore_missing_imports=True
disallow_untyped_calls=True
warn_return_any=True
strict_optional=True
warn_no_return=True
warn_redundant_casts=True
warn_unused_ignores=True
disallow_any_generics=True
disallow_untyped_defs=True
check_untyped_defs=True
cache_dir=/dev/null
[mypy-aiohttp.*]
follow_imports=skip
[mypy-_version]
follow_imports=skip
Python version used: Python 3.11
onnxscript version: 0.1.0.dev20241120
onnx version: 1.16.0
onnxruntime version: 1.16.3
Tasks
The text was updated successfully, but these errors were encountered: