提交 5db17907 编写于 作者: M Megvii Engine Team

chore(megbrain): fix megskull cnn/img opr compatiblity

    for add convolutionv2 param

GitOrigin-RevId: 9d0cf55ef46448c8d26682a8d365612880eb1321
上级 935fe781
...@@ -65,7 +65,7 @@ decl_opr('MaskConvolution', ...@@ -65,7 +65,7 @@ decl_opr('MaskConvolution',
params=[('param', 'Convolution')], params=[('param', 'Convolution')],
desc=('batched mask conv on channeled 2D images, mask is correspoding ' desc=('batched mask conv on channeled 2D images, mask is correspoding '
'to output'), 'to output'),
version=1) version=2)
decl_opr('MaskPropagate', decl_opr('MaskPropagate',
inputs=[Doc('src', inputs=[Doc('src',
...@@ -102,10 +102,11 @@ decl_opr('Local', ...@@ -102,10 +102,11 @@ decl_opr('Local',
'convolution kernel in ' 'convolution kernel in '
'(out row, out col, in channel, ' '(out row, out col, in channel, '
'kern row, kern col, out channel) format')], 'kern row, kern col, out channel) format')],
params='ConvolutionV0', params='Convolution',
desc='batched convolution on channeled 2D images, but kernels are ' desc='batched convolution on channeled 2D images, but kernels are '
'not shared across different output positions') 'not shared across different output positions', version=2)
"""
decl_opr('Local', decl_opr('Local',
pyname='local_v1', pyname='local_v1',
inputs=[Doc('src', inputs=[Doc('src',
...@@ -118,6 +119,7 @@ decl_opr('Local', ...@@ -118,6 +119,7 @@ decl_opr('Local',
desc='batched convolution on channeled 2D images, but kernels are ' desc='batched convolution on channeled 2D images, but kernels are '
'not shared across different output positions', 'not shared across different output positions',
version=1) version=1)
"""
decl_opr('GroupLocal', decl_opr('GroupLocal',
inputs=[Doc('src', inputs=[Doc('src',
...@@ -129,7 +131,7 @@ decl_opr('GroupLocal', ...@@ -129,7 +131,7 @@ decl_opr('GroupLocal',
params=[('param', 'Convolution')], params=[('param', 'Convolution')],
desc='batched convolution on groupped channeled 2D images, but ' desc='batched convolution on groupped channeled 2D images, but '
'kernels are not shared across different output positions', 'kernels are not shared across different output positions',
version=1) version=2)
decl_opr('LRN', decl_opr('LRN',
inputs=['src'], inputs=['src'],
...@@ -280,7 +282,7 @@ decl_opr('DeformableConvForward', ...@@ -280,7 +282,7 @@ decl_opr('DeformableConvForward',
Doc('mask', 'deformable mask in (batch, deformable group * filter row * filter col, output row, output col) format')], Doc('mask', 'deformable mask in (batch, deformable group * filter row * filter col, output row, output col) format')],
params=[('param', 'Convolution'), ('execution_policy', 'ExecutionPolicy')], params=[('param', 'Convolution'), ('execution_policy', 'ExecutionPolicy')],
desc=Doc(None, r""" Apply a deformable convolution to input tensor and filter tensor. The offset tensor will adjust the position of each grid of a convolution filter. The mask tensor will be applied to the deformed input tensor. """), desc=Doc(None, r""" Apply a deformable convolution to input tensor and filter tensor. The offset tensor will adjust the position of each grid of a convolution filter. The mask tensor will be applied to the deformed input tensor. """),
has_out_dtype=True) has_out_dtype=True, version=1)
decl_opr('DeformablePSROIPoolingForward', decl_opr('DeformablePSROIPoolingForward',
pyname='deformable_psroi_pooling', pyname='deformable_psroi_pooling',
......
...@@ -514,19 +514,19 @@ MGB_SEREG_OPR(ConvolutionBackwardFilterV2, 0); ...@@ -514,19 +514,19 @@ MGB_SEREG_OPR(ConvolutionBackwardFilterV2, 0);
MGB_SEREG_OPR(Images2Neibs, 1); MGB_SEREG_OPR(Images2Neibs, 1);
MGB_SEREG_OPR(Images2NeibsBackward, 2); MGB_SEREG_OPR(Images2NeibsBackward, 2);
using LocalV1 = Local; using LocalV2 = Local;
using LocalBackwardDataV1 = LocalBackwardData; using LocalBackwardDataV2 = LocalBackwardData;
using LocalBackwardFilterV1 = LocalBackwardFilter; using LocalBackwardFilterV2 = LocalBackwardFilter;
MGB_SEREG_OPR(LocalV1, 2); MGB_SEREG_OPR(LocalV2, 2);
MGB_SEREG_OPR(LocalBackwardDataV1, 3); MGB_SEREG_OPR(LocalBackwardDataV2, 3);
MGB_SEREG_OPR(LocalBackwardFilterV1, 3); MGB_SEREG_OPR(LocalBackwardFilterV2, 3);
using GroupLocalV1 = GroupLocal; using GroupLocalV2 = GroupLocal;
using GroupLocalBackwardDataV1 = GroupLocalBackwardData; using GroupLocalBackwardDataV2 = GroupLocalBackwardData;
using GroupLocalBackwardFilterV1 = GroupLocalBackwardFilter; using GroupLocalBackwardFilterV2 = GroupLocalBackwardFilter;
MGB_SEREG_OPR(GroupLocalV1, 2); MGB_SEREG_OPR(GroupLocalV2, 2);
MGB_SEREG_OPR(GroupLocalBackwardDataV1, 3); MGB_SEREG_OPR(GroupLocalBackwardDataV2, 3);
MGB_SEREG_OPR(GroupLocalBackwardFilterV1, 3); MGB_SEREG_OPR(GroupLocalBackwardFilterV2, 3);
MGB_SEREG_OPR(LRN, 1); MGB_SEREG_OPR(LRN, 1);
MGB_SEREG_OPR(LRNBackward, 3); MGB_SEREG_OPR(LRNBackward, 3);
...@@ -542,8 +542,8 @@ MGB_SEREG_OPR(AdaptivePoolingBackwardV1, 4); ...@@ -542,8 +542,8 @@ MGB_SEREG_OPR(AdaptivePoolingBackwardV1, 4);
MGB_SEREG_OPR(ROIPooling, 3); MGB_SEREG_OPR(ROIPooling, 3);
MGB_SEREG_OPR(ROIPoolingBackward, 4); MGB_SEREG_OPR(ROIPoolingBackward, 4);
using MaskConvolutionV1 = MaskConvolution; using MaskConvolutionV2 = MaskConvolution;
MGB_SEREG_OPR(MaskConvolutionV1, 3); MGB_SEREG_OPR(MaskConvolutionV2, 3);
MGB_SEREG_OPR(MaskPropagate, 1); MGB_SEREG_OPR(MaskPropagate, 1);
MGB_SEREG_OPR(Convolution3D, 0); MGB_SEREG_OPR(Convolution3D, 0);
...@@ -567,9 +567,12 @@ using ROIAlignV1 = ROIAlign; ...@@ -567,9 +567,12 @@ using ROIAlignV1 = ROIAlign;
using ROIAlignBackwardV1 = ROIAlignBackward; using ROIAlignBackwardV1 = ROIAlignBackward;
MGB_SEREG_OPR(ROIAlignV1, 2); MGB_SEREG_OPR(ROIAlignV1, 2);
MGB_SEREG_OPR(ROIAlignBackwardV1, 4); MGB_SEREG_OPR(ROIAlignBackwardV1, 4);
MGB_SEREG_OPR(DeformableConvForward, 0); using DeformableConvForwardV1 = DeformableConvForward;
MGB_SEREG_OPR(DeformableConvBackwardData, 0); using DeformableConvBackwardDataV1 = DeformableConvBackwardData;
MGB_SEREG_OPR(DeformableConvBackwardFilter, 0); using DeformableConvBackwardFilterV1 = DeformableConvBackwardFilter;
MGB_SEREG_OPR(DeformableConvForwardV1, 0);
MGB_SEREG_OPR(DeformableConvBackwardDataV1, 0);
MGB_SEREG_OPR(DeformableConvBackwardFilterV1, 0);
MGB_SEREG_OPR(DeformablePSROIPoolingForward, 3); MGB_SEREG_OPR(DeformablePSROIPoolingForward, 3);
MGB_SEREG_OPR(DeformablePSROIPoolingBackward, 5); MGB_SEREG_OPR(DeformablePSROIPoolingBackward, 5);
......
...@@ -24,8 +24,8 @@ decl_opr( ...@@ -24,8 +24,8 @@ decl_opr(
params='WarpPerspective', params='WarpPerspective',
desc='like :func:`warp_perspective`, but the **mat** param does not have ' desc='like :func:`warp_perspective`, but the **mat** param does not have '
'to have the same batch size as **src**; instead, **mat_idx** specifies ' 'to have the same batch size as **src**; instead, **mat_idx** specifies '
'the batch number of each matrix in **mat**' 'the batch number of each matrix in **mat**',
) version=2)
decl_opr('Rotate', decl_opr('Rotate',
inputs=[ inputs=[
...@@ -111,7 +111,7 @@ decl_raw_opr( ...@@ -111,7 +111,7 @@ decl_raw_opr(
'assert not kwargs, "extra kwargs: {}".format(kwargs)', 'assert not kwargs, "extra kwargs: {}".format(kwargs)',
'all_params = []', 'all_params = []',
'all_params.append(param.serialize())', 'all_params.append(param.serialize())',
'output = _mgb._create_opr("DctChannelSelect", all_inputs, all_params, config)', 'output = _mgb._create_opr("DctChannelSelectV1", all_inputs, all_params, config)',
], ],
has_out_dtype=True, has_out_dtype=True,
desc='DctChannelSelect do DCT with channel select' desc='DctChannelSelect do DCT with channel select'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册