fix export mslite model

This commit is contained in:
huanghui 2020-04-15 16:21:53 +08:00
parent 6721541c9d
commit c926c36d95
1 changed files with 6 additions and 6 deletions

View File

@ -28,8 +28,8 @@ bool Conv2dPacker(const CNodePtr &c_node_ptr, OpDefT *ms_op) {
std::vector<int> kernel_size_value = AnfAlgo::GetNodeAttr<std::vector<int>>(c_node_ptr, "kernel_size"); std::vector<int> kernel_size_value = AnfAlgo::GetNodeAttr<std::vector<int>>(c_node_ptr, "kernel_size");
std::string kernel_pad_mode_value = AnfAlgo::GetNodeAttr<std::string>(c_node_ptr, "pad_mode"); std::string kernel_pad_mode_value = AnfAlgo::GetNodeAttr<std::string>(c_node_ptr, "pad_mode");
int kernel_pad_value = AnfAlgo::GetNodeAttr<int>(c_node_ptr, "pad"); int kernel_pad_value = AnfAlgo::GetNodeAttr<int>(c_node_ptr, "pad");
int kernel_stride_value = AnfAlgo::GetNodeAttr<int>(c_node_ptr, "stride"); auto kernel_stride_value = AnfAlgo::GetNodeAttr<std::vector<int>>(c_node_ptr, "stride");
int kernel_dilation_value = AnfAlgo::GetNodeAttr<int>(c_node_ptr, "dilation"); auto kernel_dilation_value = AnfAlgo::GetNodeAttr<std::vector<int>>(c_node_ptr, "dilation");
std::string kernel_data_format_value = AnfAlgo::GetNodeAttr<std::string>(c_node_ptr, "data_format"); std::string kernel_data_format_value = AnfAlgo::GetNodeAttr<std::string>(c_node_ptr, "data_format");
std::unique_ptr<Conv2DT> attr(new Conv2DT()); std::unique_ptr<Conv2DT> attr(new Conv2DT());
MS_EXCEPTION_IF_NULL(attr); MS_EXCEPTION_IF_NULL(attr);
@ -43,15 +43,15 @@ bool Conv2dPacker(const CNodePtr &c_node_ptr, OpDefT *ms_op) {
attr->channelOut = kernel_channel_value; attr->channelOut = kernel_channel_value;
attr->kernelW = kernel_size_value[0]; attr->kernelW = kernel_size_value[0];
attr->kernelH = kernel_size_value[1]; attr->kernelH = kernel_size_value[1];
attr->strideW = kernel_stride_value; attr->strideW = kernel_stride_value[0];
attr->strideH = kernel_stride_value; attr->strideH = kernel_stride_value[1];
attr->padMode = GetAttrPadMode(kernel_pad_mode_value); attr->padMode = GetAttrPadMode(kernel_pad_mode_value);
attr->padUp = kernel_pad_value; attr->padUp = kernel_pad_value;
attr->padDown = kernel_pad_value; attr->padDown = kernel_pad_value;
attr->padLeft = kernel_pad_value; attr->padLeft = kernel_pad_value;
attr->padRight = kernel_pad_value; attr->padRight = kernel_pad_value;
attr->dilateW = kernel_dilation_value; attr->dilateW = kernel_dilation_value[0];
attr->dilateH = kernel_dilation_value; attr->dilateH = kernel_dilation_value[1];
attr->hasBias = false; attr->hasBias = false;
ms_op->name = c_node_ptr->fullname_with_scope(); ms_op->name = c_node_ptr->fullname_with_scope();
ms_op->attr.type = OpT_Conv2D; ms_op->attr.type = OpT_Conv2D;