diff --git a/mace/ops/eltwise.cc b/mace/ops/eltwise.cc index 92864ae1016fad410ce054887babd09ee2557c59..6803eca1434921321a510dbbee2457149d2f9186 100644 --- a/mace/ops/eltwise.cc +++ b/mace/ops/eltwise.cc @@ -902,6 +902,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); @@ -1192,6 +1195,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 44047c26518ea0ba00a3ea58a384b132992cc284..8e25e531ba974f32209f13c70cfc54fa1dd8a8ea 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,