Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
one
spconv
Commits
28089d88
Commit
28089d88
authored
Apr 29, 2020
by
benzlxs
Browse files
add changes for ResNet block
parent
14b8b661
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
spconv/__init__.py
spconv/__init__.py
+1
-1
spconv/modules.py
spconv/modules.py
+7
-4
No files found.
spconv/__init__.py
View file @
28089d88
...
@@ -23,7 +23,7 @@ from spconv.conv import SparseConvTranspose2d, SparseConvTranspose3d
...
@@ -23,7 +23,7 @@ from spconv.conv import SparseConvTranspose2d, SparseConvTranspose3d
from
spconv.conv
import
SparseInverseConv2d
,
SparseInverseConv3d
from
spconv.conv
import
SparseInverseConv2d
,
SparseInverseConv3d
from
spconv.modules
import
SparseModule
,
SparseSequential
from
spconv.modules
import
SparseModule
,
SparseSequential
from
spconv.pool
import
SparseMaxPool2d
,
SparseMaxPool3d
from
spconv.pool
import
SparseMaxPool2d
,
SparseMaxPool3d
from
spconv.tables
import
ConcatTable
,
JoinTable
from
spconv.tables
import
ConcatTable
,
JoinTable
,
AddTable
from
spconv.identity
import
Identity
from
spconv.identity
import
Identity
from
spconv
import
ops
from
spconv
import
ops
...
...
spconv/modules.py
View file @
28089d88
...
@@ -125,6 +125,9 @@ class SparseSequential(SparseModule):
...
@@ -125,6 +125,9 @@ class SparseSequential(SparseModule):
def
forward
(
self
,
input
):
def
forward
(
self
,
input
):
for
k
,
module
in
self
.
_modules
.
items
():
for
k
,
module
in
self
.
_modules
.
items
():
if
is_spconv_module
(
module
):
# use SpConvTensor as input
if
is_spconv_module
(
module
):
# use SpConvTensor as input
if
isinstance
(
input
,
list
):
input
=
module
(
input
)
else
:
assert
isinstance
(
input
,
spconv
.
SparseConvTensor
)
assert
isinstance
(
input
,
spconv
.
SparseConvTensor
)
self
.
_sparity_dict
[
k
]
=
input
.
sparity
self
.
_sparity_dict
[
k
]
=
input
.
sparity
input
=
module
(
input
)
input
=
module
(
input
)
...
...
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