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
0a42034e
Commit
0a42034e
authored
Mar 14, 2018
by
rusty1s
Browse files
test autograd x and weight
parent
599b6042
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test/test_spline_conv.py
test/test_spline_conv.py
+2
-2
No files found.
test/test_spline_conv.py
View file @
0a42034e
...
@@ -55,10 +55,10 @@ def test_spline_weighting_backward_cpu():
...
@@ -55,10 +55,10 @@ def test_spline_weighting_backward_cpu():
op
=
SplineWeighting
(
kernel_size
,
is_open_spline
,
degree
)
op
=
SplineWeighting
(
kernel_size
,
is_open_spline
,
degree
)
x
=
torch
.
DoubleTensor
(
16
,
2
).
uniform_
(
-
1
,
1
)
x
=
torch
.
DoubleTensor
(
16
,
2
).
uniform_
(
-
1
,
1
)
x
=
Variable
(
x
)
x
=
Variable
(
x
,
requires_grad
=
True
)
pseudo
=
torch
.
DoubleTensor
(
16
,
3
).
uniform_
(
0
,
1
)
pseudo
=
torch
.
DoubleTensor
(
16
,
3
).
uniform_
(
0
,
1
)
pseudo
=
Variable
(
torch
.
DoubleTensor
(
pseudo
),
requires_grad
=
True
)
pseudo
=
Variable
(
torch
.
DoubleTensor
(
pseudo
),
requires_grad
=
True
)
weight
=
torch
.
DoubleTensor
(
25
,
2
,
4
).
uniform_
(
-
1
,
1
)
weight
=
torch
.
DoubleTensor
(
25
,
2
,
4
).
uniform_
(
-
1
,
1
)
weight
=
Variable
(
weight
)
weight
=
Variable
(
weight
,
requires_grad
=
True
)
assert
gradcheck
(
op
,
(
x
,
pseudo
,
weight
),
eps
=
1e-6
,
atol
=
1e-4
)
is
True
assert
gradcheck
(
op
,
(
x
,
pseudo
,
weight
),
eps
=
1e-6
,
atol
=
1e-4
)
is
True
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