Skip to content

Arm backend: Convert asserts to raise errors in op_mul #10134

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

Merged
merged 2 commits into from
Apr 22, 2025
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
10 changes: 9 additions & 1 deletion backends/arm/operators/op_mul.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ def define_node(
inputs: List[TosaArg],
output: TosaArg,
) -> None:
assert inputs[0].dtype == inputs[1].dtype == output.dtype == ts.DType.INT8
if (
inputs[0].dtype != ts.DType.INT8
or inputs[1].dtype != ts.DType.INT8
or output.dtype != ts.DType.INT8
):
raise ValueError(
f"Inputs and output for {self.target} need to be INT8, got "
f"{inputs[0].dtype=}, {inputs[1].dtype=} and {output.dtype=}"
)

dim_order = (
inputs[0].dim_order
Expand Down
Loading