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-sparse
Commits
105a60be
Commit
105a60be
authored
Jan 18, 2021
by
rusty1s
Browse files
fix spmm for highly sparse matrices
parent
fca68194
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
csrc/cpu/spmm_cpu.cpp
csrc/cpu/spmm_cpu.cpp
+2
-2
No files found.
csrc/cpu/spmm_cpu.cpp
View file @
105a60be
...
...
@@ -56,8 +56,8 @@ spmm_cpu(torch::Tensor rowptr, torch::Tensor col,
value_data
=
optional_value
.
value
().
data_ptr
<
scalar_t
>
();
}
int64_t
grain_size
=
at
::
internal
::
GRAIN_SIZE
/
(
K
*
(
col
.
numel
()
/
M
));
int64_t
grain_size
=
at
::
internal
::
GRAIN_SIZE
/
(
K
*
std
::
max
(
col
.
numel
()
/
M
,
(
int64_t
)
1
));
at
::
parallel_for
(
0
,
B
*
M
,
grain_size
,
[
&
](
int64_t
begin
,
int64_t
end
)
{
scalar_t
val
;
...
...
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