mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[WebNN EP] Support Greater and Less ops (#16782)
This commit is contained in:
parent
8ede2f139e
commit
5d17bcd776
3 changed files with 10 additions and 0 deletions
|
|
@ -153,6 +153,7 @@ static const InlinedHashMap<std::string, std::string> op_map = {
|
|||
{"Gemm", "gemm"},
|
||||
{"GlobalAveragePool", "averagePool2d"},
|
||||
{"GlobalMaxPool", "maxPool2d"},
|
||||
{"Greater", "greater"},
|
||||
{"GroupNormalization", "meanVarianceNormalization"},
|
||||
{"HardSigmoid", "hardSigmoid"},
|
||||
{"HardSwish", "hardSwish"},
|
||||
|
|
@ -160,6 +161,7 @@ static const InlinedHashMap<std::string, std::string> op_map = {
|
|||
{"InstanceNormalization", "meanVarianceNormalization"},
|
||||
{"LayerNormalization", "meanVarianceNormalization"},
|
||||
{"LeakyRelu", "leakyRelu"},
|
||||
{"Less", "lesser"},
|
||||
{"MatMul", "matmul"},
|
||||
{"MaxPool", "maxPool2d"},
|
||||
{"Mul", "mul"},
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ Status LogicalOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, cons
|
|||
emscripten::val output = emscripten::val::object();
|
||||
if (op_type == "Equal") {
|
||||
output = model_builder.GetBuilder().call<emscripten::val>("equal", input0, input1);
|
||||
} else if (op_type == "Greater") {
|
||||
output = model_builder.GetBuilder().call<emscripten::val>("greater", input0, input1);
|
||||
} else if (op_type == "Less") {
|
||||
output = model_builder.GetBuilder().call<emscripten::val>("lesser", input0, input1);
|
||||
} else {
|
||||
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT,
|
||||
"LogicalOpBuilder::AddToModelBuilderImpl, unknown op: ", op_type);
|
||||
|
|
@ -49,6 +53,8 @@ void CreateLogicalOpBuilder(const std::string& op_type, OpBuilderRegistrations&
|
|||
static std::vector<std::string> op_types =
|
||||
{
|
||||
"Equal",
|
||||
"Greater",
|
||||
"Less",
|
||||
};
|
||||
|
||||
op_registrations.builders.push_back(std::make_unique<LogicalOpBuilder>());
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ static OpBuilderRegistrations CreateOpBuilderRegistrations() {
|
|||
|
||||
{ // Logical
|
||||
CreateLogicalOpBuilder("Equal", op_registrations);
|
||||
CreateLogicalOpBuilder("Greater", op_registrations);
|
||||
CreateLogicalOpBuilder("Less", op_registrations);
|
||||
}
|
||||
|
||||
{ // Normalization
|
||||
|
|
|
|||
Loading…
Reference in a new issue