提交 a33e507c 编写于 作者: 叶剑武

Merge branch 'polish-eltwise' into 'master'

Add input size validation for Eltwise Op.

See merge request !1060
......@@ -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<DeviceType::GPU, T> : 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);
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册