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
492865a3
Commit
492865a3
authored
Jun 04, 2020
by
yanyan
Browse files
faster subm indice generation by
unroll loop for common params
parent
9a23d934
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test/test_conv.py
test/test_conv.py
+7
-5
No files found.
test/test_conv.py
View file @
492865a3
...
...
@@ -651,7 +651,8 @@ def main(algo=spconv.ConvAlgo.Native, dtype=torch.float32):
indices_t
=
torch
.
from_numpy
(
indices
).
int
().
to
(
device
).
to
(
dtype
)
features_t
=
torch
.
from_numpy
(
features
).
to
(
device
).
to
(
dtype
)
features_dense_t
=
torch
.
from_numpy
(
features_dense
).
to
(
device
).
to
(
dtype
)
features_dense_t
=
torch
.
from_numpy
(
features_dense
).
to
(
device
).
to
(
dtype
)
net
=
SparseConv3dTestTorch
(
1
,
3
,
shape
,
IC
,
OC
,
k
,
s
,
p
,
d
,
algo
=
algo
).
to
(
device
).
to
(
dtype
)
net_ref
=
Conv3dTestTorch
(
1
,
3
,
shape
,
IC
,
OC
,
k
,
s
,
p
,
...
...
@@ -718,7 +719,8 @@ def main_subm(algo, dtype=torch.float32):
indices_t
=
torch
.
from_numpy
(
indices
).
int
().
to
(
device
).
to
(
dtype
)
features_t
=
torch
.
from_numpy
(
features
).
to
(
device
).
to
(
dtype
)
features_dense_t
=
torch
.
from_numpy
(
features_dense
).
to
(
device
).
to
(
dtype
)
features_dense_t
=
torch
.
from_numpy
(
features_dense
).
to
(
device
).
to
(
dtype
)
net
=
SubMConv3dTestTorch
(
1
,
3
,
shape
,
IC
,
OC
,
k
,
s
,
p
,
d
,
algo
=
algo
).
to
(
device
).
to
(
dtype
)
net_ref
=
Conv3dTestTorch
(
1
,
3
,
shape
,
IC
,
OC
,
k
,
s
,
p
,
...
...
@@ -750,8 +752,8 @@ def main_subm(algo, dtype=torch.float32):
if
__name__
==
'__main__'
:
main
(
algo
=
spconv
.
ConvAlgo
.
Native
,
dtype
=
torch
.
float32
)
main
(
algo
=
spconv
.
ConvAlgo
.
Native
,
dtype
=
torch
.
half
)
#
main
_subm
(algo=spconv.ConvAlgo.Native, dtype=torch.float32)
#
main
_subm
(algo=spconv.ConvAlgo.Native, dtype=torch.half)
# TestCase().assertAllClose(out_my, out_ref)
# unittest.main()
#
TestSpConv().testSpConv3d()
TestSpConv
().
testSpConv3d
()
Prev
1
2
Next
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