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
73322b61
Commit
73322b61
authored
Mar 06, 2018
by
Jan Eric Lenssen
Browse files
small kernel change
parent
e2e17501
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
spline_conv_gpu.py
spline_conv_gpu.py
+2
-2
No files found.
spline_conv_gpu.py
View file @
73322b61
...
@@ -349,7 +349,7 @@ int num_threads) {
...
@@ -349,7 +349,7 @@ int num_threads) {
${Dtype} grad_out = 0.0;
${Dtype} grad_out = 0.0;
long i = 0;
long i = 0;
int quotient = (int)pow(2.0,(float)d_idx)
int quotient = (int)pow(2.0,(float)d_idx)
;
for (int k_idx = 0; k_idx < ${k_max}; k_idx++) {
for (int k_idx = 0; k_idx < ${k_max}; k_idx++) {
...
@@ -359,7 +359,7 @@ int num_threads) {
...
@@ -359,7 +359,7 @@ int num_threads) {
value *= kernel_size[d_idx] - is_open_spline[d_idx];
value *= kernel_size[d_idx] - is_open_spline[d_idx];
frac = value - floor(value);
frac = value - floor(value);
residual = (1 - k_idx_mod) * frac + k_idx_mod *
(1 -
frac
)
;
residual = (1 - k_idx_mod) *
(
frac
- 1)
+ k_idx_mod * frac;
int a_idx = e_idx*${k_max} + k_idx
int a_idx = e_idx*${k_max} + k_idx
grad_out += grad_amount[a_idx]*amount[a_idx]/residual;
grad_out += grad_amount[a_idx]*amount[a_idx]/residual;
...
...
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