Skip to content
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
23 changes: 15 additions & 8 deletions backends/arm/operators/op_minimum.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,27 @@ def define_node(
inputs: List[TosaArg],
output: TosaArg,
) -> None:
assert inputs[0].dtype == inputs[1].dtype
if inputs[0].dtype != inputs[1].dtype and inputs[0].dtype != output.dtype:
raise TypeError(
f"Data type of inputs and output must be the same. Got input 0 dtype: "
f"{inputs[0].dtype}, input 1 dtype: {inputs[1].dtype} and output "
f"dtype: {output.dtype}"
)

scale_back = 1.0
min_output = output
if inputs[0].dtype == ts.DType.INT8:
input_qparams = get_input_qparams(node)
assert (
len(input_qparams) == 2
), f"Both inputs needs to have quantization information for {node}"
# insert RESCALEs to int32
assert (
input_qparams[0] == input_qparams[1]
), "Both inputs must have same quantization for MIN"
if len(input_qparams) != 2:
raise ValueError(
f"Both inputs need to have quantization information for {node}"
)
if input_qparams[0] != input_qparams[1]:
raise ValueError(
"Both inputs must have the same quantization parameters for MIN"
)

# insert RESCALEs to int32
operand_inputs, scale_back = tqutils.insert_rescale_ops_to_int32(
tosa_graph, inputs, node
)
Expand Down
Loading