Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
44edcdd9
"...text-generation-inference.git" did not exist on "ab7ccf5bc3c84e07d0faf0d950421fcdc29743b5"
Unverified
Commit
44edcdd9
authored
Aug 16, 2021
by
q.yao
Committed by
GitHub
Aug 16, 2021
Browse files
add onnx namespace for custom ops (#1254)
parent
54907a39
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
35 deletions
+38
-35
mmcv/ops/carafe.py
mmcv/ops/carafe.py
+8
-8
mmcv/ops/cc_attention.py
mmcv/ops/cc_attention.py
+2
-2
mmcv/ops/deform_roi_pool.py
mmcv/ops/deform_roi_pool.py
+6
-6
mmcv/ops/focal_loss.py
mmcv/ops/focal_loss.py
+10
-10
mmcv/ops/masked_conv.py
mmcv/ops/masked_conv.py
+3
-3
mmcv/ops/psa_mask.py
mmcv/ops/psa_mask.py
+4
-1
mmcv/ops/sync_bn.py
mmcv/ops/sync_bn.py
+5
-5
No files found.
mmcv/ops/carafe.py
View file @
44edcdd9
...
@@ -19,12 +19,12 @@ class CARAFENaiveFunction(Function):
...
@@ -19,12 +19,12 @@ class CARAFENaiveFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
def
symbolic
(
g
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
return
g
.
op
(
return
g
.
op
(
'MMCVCARAFENaive'
,
'
mmcv::
MMCVCARAFENaive'
,
features
,
features
,
masks
,
masks
,
kernel_size
=
kernel_size
,
kernel_size
_i
=
kernel_size
,
group_size
=
group_size
,
group_size
_i
=
group_size
,
scale_factor
=
scale_factor
)
scale_factor
_f
=
scale_factor
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
def
forward
(
ctx
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
...
@@ -102,12 +102,12 @@ class CARAFEFunction(Function):
...
@@ -102,12 +102,12 @@ class CARAFEFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
def
symbolic
(
g
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
return
g
.
op
(
return
g
.
op
(
'MMCVCARAFE'
,
'
mmcv::
MMCVCARAFE'
,
features
,
features
,
masks
,
masks
,
kernel_size
=
kernel_size
,
kernel_size
_i
=
kernel_size
,
group_size
=
group_size
,
group_size
_i
=
group_size
,
scale_factor
=
scale_factor
)
scale_factor
_f
=
scale_factor
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
def
forward
(
ctx
,
features
,
masks
,
kernel_size
,
group_size
,
scale_factor
):
...
...
mmcv/ops/cc_attention.py
View file @
44edcdd9
...
@@ -15,7 +15,7 @@ class CAWeightFunction(torch.autograd.Function):
...
@@ -15,7 +15,7 @@ class CAWeightFunction(torch.autograd.Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
t
,
f
):
def
symbolic
(
g
,
t
,
f
):
return
g
.
op
(
'MMCVCAWeight'
,
t
,
f
)
return
g
.
op
(
'
mmcv::
MMCVCAWeight'
,
t
,
f
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
t
,
f
):
def
forward
(
ctx
,
t
,
f
):
...
@@ -41,7 +41,7 @@ class CAMapFunction(torch.autograd.Function):
...
@@ -41,7 +41,7 @@ class CAMapFunction(torch.autograd.Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
weight
,
v
):
def
symbolic
(
g
,
weight
,
v
):
return
g
.
op
(
'MMCVCAMap'
,
weight
,
v
)
return
g
.
op
(
'
mmcv::
MMCVCAMap'
,
weight
,
v
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
weight
,
v
):
def
forward
(
ctx
,
weight
,
v
):
...
...
mmcv/ops/deform_roi_pool.py
View file @
44edcdd9
...
@@ -16,15 +16,15 @@ class DeformRoIPoolFunction(Function):
...
@@ -16,15 +16,15 @@ class DeformRoIPoolFunction(Function):
def
symbolic
(
g
,
input
,
rois
,
offset
,
output_size
,
spatial_scale
,
def
symbolic
(
g
,
input
,
rois
,
offset
,
output_size
,
spatial_scale
,
sampling_ratio
,
gamma
):
sampling_ratio
,
gamma
):
return
g
.
op
(
return
g
.
op
(
'MMCVDeformRoIPool'
,
'
mmcv::
MMCVDeformRoIPool'
,
input
,
input
,
rois
,
rois
,
offset
,
offset
,
pooled_height
=
output_size
[
0
],
pooled_height
_i
=
output_size
[
0
],
pooled_width
=
output_size
[
1
],
pooled_width
_i
=
output_size
[
1
],
spatial_scale
=
spatial_scale
,
spatial_scale
_f
=
spatial_scale
,
sampling_ratio
=
sampling_ratio
,
sampling_ratio
_f
=
sampling_ratio
,
gamma
=
gamma
)
gamma
_f
=
gamma
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
def
forward
(
ctx
,
...
...
mmcv/ops/focal_loss.py
View file @
44edcdd9
...
@@ -17,13 +17,13 @@ class SigmoidFocalLossFunction(Function):
...
@@ -17,13 +17,13 @@ class SigmoidFocalLossFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
input
,
target
,
gamma
,
alpha
,
weight
,
reduction
):
def
symbolic
(
g
,
input
,
target
,
gamma
,
alpha
,
weight
,
reduction
):
return
g
.
op
(
return
g
.
op
(
'MMCVSigmoidFocalLoss'
,
'
mmcv::
MMCVSigmoidFocalLoss'
,
input
,
input
,
target
,
target
,
gamma
=
gamma
,
gamma
_f
=
gamma
,
alpha
=
alpha
,
alpha
_f
=
alpha
,
weight
=
weight
,
weight
_f
=
weight
,
reduction
=
reduction
)
reduction
_s
=
reduction
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
def
forward
(
ctx
,
...
@@ -111,13 +111,13 @@ class SoftmaxFocalLossFunction(Function):
...
@@ -111,13 +111,13 @@ class SoftmaxFocalLossFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
input
,
target
,
gamma
,
alpha
,
weight
,
reduction
):
def
symbolic
(
g
,
input
,
target
,
gamma
,
alpha
,
weight
,
reduction
):
return
g
.
op
(
return
g
.
op
(
'MMCVSoftmaxFocalLoss'
,
'
mmcv::
MMCVSoftmaxFocalLoss'
,
input
,
input
,
target
,
target
,
gamma
=
gamma
,
gamma
_f
=
gamma
,
alpha
=
alpha
,
alpha
_f
=
alpha
,
weight
=
weight
,
weight
_f
=
weight
,
reduction
=
reduction
)
reduction
_s
=
reduction
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
def
forward
(
ctx
,
...
...
mmcv/ops/masked_conv.py
View file @
44edcdd9
...
@@ -18,13 +18,13 @@ class MaskedConv2dFunction(Function):
...
@@ -18,13 +18,13 @@ class MaskedConv2dFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
features
,
mask
,
weight
,
bias
,
padding
,
stride
):
def
symbolic
(
g
,
features
,
mask
,
weight
,
bias
,
padding
,
stride
):
return
g
.
op
(
return
g
.
op
(
'MMCVMaskedConv2d'
,
'
mmcv::
MMCVMaskedConv2d'
,
features
,
features
,
mask
,
mask
,
weight
,
weight
,
bias
,
bias
,
padding
=
padding
,
padding
_i
=
padding
,
stride
=
stride
)
stride
_i
=
stride
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
features
,
mask
,
weight
,
bias
,
padding
=
0
,
stride
=
1
):
def
forward
(
ctx
,
features
,
mask
,
weight
,
bias
,
padding
=
0
,
stride
=
1
):
...
...
mmcv/ops/psa_mask.py
View file @
44edcdd9
...
@@ -14,7 +14,10 @@ class PSAMaskFunction(Function):
...
@@ -14,7 +14,10 @@ class PSAMaskFunction(Function):
@
staticmethod
@
staticmethod
def
symbolic
(
g
,
input
,
psa_type
,
mask_size
):
def
symbolic
(
g
,
input
,
psa_type
,
mask_size
):
return
g
.
op
(
return
g
.
op
(
'MMCVPSAMask'
,
input
,
psa_type
=
psa_type
,
mask_size
=
mask_size
)
'mmcv::MMCVPSAMask'
,
input
,
psa_type_i
=
psa_type
,
mask_size_i
=
mask_size
)
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
input
,
psa_type
,
mask_size
):
def
forward
(
ctx
,
input
,
psa_type
,
mask_size
):
...
...
mmcv/ops/sync_bn.py
View file @
44edcdd9
...
@@ -22,16 +22,16 @@ class SyncBatchNormFunction(Function):
...
@@ -22,16 +22,16 @@ class SyncBatchNormFunction(Function):
def
symbolic
(
g
,
input
,
running_mean
,
running_var
,
weight
,
bias
,
momentum
,
def
symbolic
(
g
,
input
,
running_mean
,
running_var
,
weight
,
bias
,
momentum
,
eps
,
group
,
group_size
):
eps
,
group
,
group_size
):
return
g
.
op
(
return
g
.
op
(
'MMCVSyncBatchNorm'
,
'
mmcv::
MMCVSyncBatchNorm'
,
input
,
input
,
running_mean
,
running_mean
,
running_var
,
running_var
,
weight
,
weight
,
bias
,
bias
,
momentum
=
momentum
,
momentum
_f
=
momentum
,
eps
=
eps
,
eps
_f
=
eps
,
group
=
group
,
group
_i
=
group
,
group_size
=
group_size
)
group_size
_i
=
group_size
)
@
staticmethod
@
staticmethod
def
forward
(
self
,
input
,
running_mean
,
running_var
,
weight
,
bias
,
momentum
,
def
forward
(
self
,
input
,
running_mean
,
running_var
,
weight
,
bias
,
momentum
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment