未验证 提交 84d2a1b8 编写于 作者: S shitouren1994 提交者: GitHub

bug fix (#1142)

* bug fix 1.eltwise div error 2.instancenorm w==0 error fix 3.onnx2tengine deconv output channel error

* apply code-format changes
Co-authored-by: Nshitouren1994 <shitouren1994@users.noreply.github.com>
上级 5dc445ce
......@@ -223,6 +223,16 @@ static int ref_eltwise_fp32(void* output, void* input0, void* input1, int type,
*out_ptr++ = in0[i] / in1[i / input_hw];
}
}
else if (input_hw == input_hw_1)
{
for (int i = 0; i < input_chan; i++)
{
for (int j = 0; j < input_hw; j++)
{
*out_ptr++ = in0[i * input_hw + j] / in1[j];
}
}
}
else
{
break;
......
......@@ -198,6 +198,11 @@ static int run(struct node_ops* node_ops, struct exec_node* exec_node, struct ex
int h = input_tensor->dims[2];
int w = input_tensor->dims[3];
if (w == 0)
{
w = 1;
}
int size = w * h;
void* in_data = input_tensor->data;
......
......@@ -2008,7 +2008,8 @@ static int load_deconv(ir_graph_t* graph, ir_node_t* node, const onnx::NodeProto
{
int* dim = tensor->dims;
/* onnx hide the output channel in weight ..*/
deconv_param->num_output = dim[1];
/* The number of channels in the output should be equal to W.shape[1] * group */
deconv_param->num_output = dim[1] * deconv_param->group;
deconv_param->kernel_h = dim[2];
deconv_param->kernel_w = dim[3];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册