Skip to content
Merged
Show file tree
Hide file tree
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 @@ -47,6 +47,7 @@ OpBuilderRegistrations::OpBuilderRegistrations() {
CreateSimpleOpBuilder("Sin", *this);
CreateSimpleOpBuilder("Sqrt", *this);
CreateSimpleOpBuilder("Sub", *this);
CreateSimpleOpBuilder("Sum", *this);
CreateSimpleOpBuilder("Tanh", *this);

CreateSimpleOpBuilder("Concat", *this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class BaseOpBuilder : public IOpBuilder {
{"Softmax", QNN_OP_SOFTMAX},
{"Sqrt", QNN_OP_ELEMENT_WISE_SQUARE_ROOT},
{"Sub", QNN_OP_ELEMENT_WISE_SUBTRACT},
{"Sum", QNN_OP_ELEMENT_WISE_ADD},
{"Tanh", QNN_OP_TANH},
{"Transpose", QNN_OP_TRANSPOSE},
{"GridSample", QNN_OP_GRID_SAMPLE},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,18 @@ Status SimpleOpBuilder::ExplicitOpCheck(QnnModelWrapper& qnn_model_wrapper,
padding_mode.c_str());
}

// ONNX's Min and Max operators accept a variable number of inputs (i.e., variadic).
// However, QNN's Min and Max operators must take in exactly two inputs.
// ONNX's Min, Max, and Sum operators accept a variable number of inputs (i.e., variadic).
// However, QNN's Min, Max, and Add operators must take in exactly two inputs.
if (op_type == "Min" || op_type == "Max") {
ORT_RETURN_IF_NOT(node_unit.Inputs().size() == 2,
"QNN EP only supports Min and Max operators with exactly 2 inputs.");
"QNN EP only supports ", op_type.c_str(), " operator with exactly 2 inputs.");
}

if (op_type == "Sum") {
size_t inputs_num = node_unit.Inputs().size();
ORT_RETURN_IF_NOT(inputs_num == 2,
"QNN EP supports Sum operator with QNN_OP_ELEMENT_WISE_ADD, which takes exactly 2 inputs. Got ONNX's Sum operator with ",
std::to_string(inputs_num).c_str(), " inputs.");
}

if (op_type == "DequantizeLinear") {
Expand Down
Loading