diff --git a/mace/ops/eltwise.cc b/mace/ops/eltwise.cc index bfe0074289363169ab41af72db5489b343ff2c84..b09cb05dd1a07da26f88f83ba7c0d7a28465417c 100644 --- a/mace/ops/eltwise.cc +++ b/mace/ops/eltwise.cc @@ -872,6 +872,9 @@ class EltwiseOp : public Operation { MaceStatus Run(OpContext *context) override { MACE_UNUSED(context); + MACE_CHECK(this->InputSize() < 3, + "Element-Wise does not support 3 or higher inputs," + " you could change your model to multiple Element-Wise"); const Tensor *input0 = this->Input(0); const Tensor *input1 = this->InputSize() == 2 ? this->Input(1) : nullptr; Tensor *output = this->Output(0); @@ -1179,6 +1182,9 @@ class EltwiseOp : public Operation { } } MaceStatus Run(OpContext *context) override { + MACE_CHECK(this->InputSize() < 3, + "Element-Wise does not support 3 or higher inputs," + " you could change your model to multiple Element-Wise"); const Tensor *input0 = this->Input(0); const Tensor *input1 = this->InputSize() == 2 ? this->Input(1) : nullptr; Tensor *output = this->Output(0); diff --git a/tools/sh_commands.py b/tools/sh_commands.py index 3b98c7a691bf6a047bdc91bfd4c90cc36d336d4e..a5c50fc4ca7dd8fa51352b5e428ab803380d17cc 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -787,7 +787,7 @@ def validate_model(abi, "--output_data_format=%s" % ",".join(output_data_formats), "--validation_threshold=%f" % validation_threshold, "--input_data_type=%s" % ",".join(input_data_types), - "--backend=%s" % ",".join(backend), + "--backend=%s" % backend, "--validation_outputs_data=%s" % ",".join( validation_outputs_data), "--log_file=%s" % log_file,