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-cluster
Commits
99d0792e
Commit
99d0792e
authored
Aug 05, 2020
by
rusty1s
Browse files
fix for pytorch 1.6.0
parent
8f5a1e3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
csrc/cpu/grid_cpu.cpp
csrc/cpu/grid_cpu.cpp
+2
-2
No files found.
csrc/cpu/grid_cpu.cpp
View file @
99d0792e
...
...
@@ -32,13 +32,13 @@ torch::Tensor grid_cpu(torch::Tensor pos, torch::Tensor size,
pos
=
pos
-
start
.
unsqueeze
(
0
);
auto
num_voxels
=
(
(
end
-
start
)
/
size
).
toType
(
torch
::
kLong
)
+
1
;
auto
num_voxels
=
(
end
-
start
)
.
true_divide
(
size
).
toType
(
torch
::
kLong
)
+
1
;
num_voxels
=
num_voxels
.
cumprod
(
0
);
num_voxels
=
torch
::
cat
({
torch
::
ones
(
1
,
num_voxels
.
options
()),
num_voxels
},
0
);
num_voxels
=
num_voxels
.
narrow
(
0
,
0
,
size
.
size
(
0
));
auto
out
=
(
pos
/
size
.
view
({
1
,
-
1
})).
toType
(
torch
::
kLong
);
auto
out
=
pos
.
true_divide
(
size
.
view
({
1
,
-
1
})).
toType
(
torch
::
kLong
);
out
*=
num_voxels
.
view
({
1
,
-
1
});
out
=
out
.
sum
(
1
);
...
...
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