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
26327cf5
Commit
26327cf5
authored
Mar 12, 2018
by
rusty1s
Browse files
fixed pragmas
parent
69d73030
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
torch_spline_conv/functions/ffi.py
torch_spline_conv/functions/ffi.py
+7
-8
No files found.
torch_spline_conv/functions/ffi.py
View file @
26327cf5
...
...
@@ -26,9 +26,8 @@ def spline_basis_forward(degree, pseudo, kernel_size, is_open_spline, K):
return
basis
,
weight_index
# pragma: no cover
def
spline_basis_backward
(
degree
,
grad_basis
,
pseudo
,
kernel_size
,
is_open_spline
):
is_open_spline
):
# pragma: no cover
grad_pseudo
=
pseudo
.
new
(
pseudo
.
size
())
func
=
get_func
(
'{}_basis_backward'
.
format
(
get_degree_str
(
degree
)),
pseudo
)
func
(
grad_pseudo
,
grad_basis
,
pseudo
,
kernel_size
,
is_open_spline
)
...
...
@@ -42,24 +41,24 @@ def spline_weighting_forward(x, weight, basis, weight_index):
return
output
# pragma: no cover
def
spline_weighting_backward_input
(
grad_output
,
weight
,
basis
,
weight_index
):
def
spline_weighting_backward_input
(
grad_output
,
weight
,
basis
,
weight_index
):
# pragma: no cover
grad_input
=
grad_output
.
new
(
grad_output
.
size
(
0
),
weight
.
size
(
1
))
func
=
get_func
(
'weighting_backward_input'
,
grad_output
)
func
(
grad_input
,
grad_output
,
weight
,
basis
,
weight_index
)
return
grad_input
# pragma: no cover
def
spline_weighting_backward_basis
(
grad_output
,
x
,
weight
,
weight_index
):
def
spline_weighting_backward_basis
(
grad_output
,
x
,
weight
,
weight_index
):
# pragma: no cover
grad_basis
=
x
.
new
(
weight_index
.
size
())
func
=
get_func
(
'weighting_backward_basis'
,
x
)
func
(
grad_basis
,
grad_output
,
x
,
weight
,
weight_index
)
return
grad_basis
# pragma: no cover
def
spline_weighting_backward_weight
(
grad_output
,
x
,
basis
,
weight_index
,
K
):
def
spline_weighting_backward_weight
(
grad_output
,
x
,
basis
,
weight_index
,
K
):
# pragma: no cover
grad_weight
=
x
.
new
(
K
,
x
.
size
(
1
),
grad_output
.
size
(
1
)).
fill_
(
0
)
func
=
get_func
(
'weighting_backward_weight'
,
x
)
func
(
grad_weight
,
grad_output
,
x
,
basis
,
weight_index
)
...
...
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