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
torch-spline-conv
Commits
bbe0254f
"tools/vscode:/vscode.git/clone" did not exist on "1e50156ea1e1813665f20b2cb558a81095da88a5"
Commit
bbe0254f
authored
Mar 14, 2018
by
rusty1s
Browse files
added benchmark
parent
5e6f3394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
benchmark/benchmark.py
benchmark/benchmark.py
+26
-0
No files found.
benchmark/benchmark.py
0 → 100644
View file @
bbe0254f
import
time
import
torch
from
torch_spline_conv.functions.ffi
import
spline_basis_forward
n
,
d
=
9999999
,
5
pseudo
=
torch
.
FloatTensor
(
n
,
d
).
uniform_
(
0
,
1
)
kernel_size
=
torch
.
LongTensor
(
d
).
fill_
(
5
)
is_open_spline
=
torch
.
ByteTensor
(
d
).
fill_
(
1
)
K
=
kernel_size
.
prod
()
t
=
time
.
perf_counter
()
basis
,
index
=
spline_basis_forward
(
1
,
pseudo
,
kernel_size
,
is_open_spline
,
K
)
t
=
time
.
perf_counter
()
-
t
print
(
'CPU:'
,
t
)
pseudo
=
pseudo
.
cuda
()
kernel_size
=
kernel_size
.
cuda
()
is_open_spline
=
is_open_spline
.
cuda
()
torch
.
cuda
.
synchronize
()
t
=
time
.
perf_counter
()
basis
,
index
=
spline_basis_forward
(
1
,
pseudo
,
kernel_size
,
is_open_spline
,
K
)
torch
.
cuda
.
synchronize
()
t
=
time
.
perf_counter
()
-
t
print
(
'GPU:'
,
t
)
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