Skip to content
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

Fix missing type in _add_attribute_to_torchscript_node for Deberta models #1773

Merged
merged 5 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,18 @@
return node.fs_(key, list(value)) # type: ignore[arg-type]
if isinstance(value[0], int):
return node.is_(key, list(value)) # type: ignore[attr-defined]
raise TypeError(f"Unsupported sequence type '{type(value)}' for attribute '{key}'")
raise TypeError(f"Unsupported attribute type '{type(value)}' for attribute '{key}'")
raise TypeError(
f"Unsupported sequence type '{type(value)}' for attribute '{key}' in "
f"node={node!r}, value is {value!r}"
)
if "TensorProtoDataType" in str(type(value)):
xadupre marked this conversation as resolved.
Show resolved Hide resolved
# torch._C._onnx.TensorProtoDataType
return node.i_(key, int(value))

raise TypeError(

Check warning on line 470 in onnxscript/function_libs/torch_lib/graph_building/_graph_building_torch.py

View check run for this annotation

Codecov / codecov/patch

onnxscript/function_libs/torch_lib/graph_building/_graph_building_torch.py#L470

Added line #L470 was not covered by tests
f"Unsupported attribute type '{type(value)}' for attribute '{key}' "
f"in node={node!r}, value is {value!r}"
)


@runtime_typing.checked
Expand Down
Loading