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
apex
Commits
297ab210
Unverified
Commit
297ab210
authored
Oct 04, 2021
by
Jeff Daily
Committed by
GitHub
Oct 04, 2021
Browse files
in multi tensor apply, skip empty tensors (#54)
parent
e57c84e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
csrc/multi_tensor_apply.cuh
csrc/multi_tensor_apply.cuh
+4
-0
No files found.
csrc/multi_tensor_apply.cuh
View file @
297ab210
...
@@ -85,6 +85,10 @@ void multi_tensor_apply(
...
@@ -85,6 +85,10 @@ void multi_tensor_apply(
for
(
int
t
=
0
;
t
<
ntensors
;
t
++
)
for
(
int
t
=
0
;
t
<
ntensors
;
t
++
)
{
{
tl
.
sizes
[
loc_tensor_info
]
=
tensor_lists
[
0
][
t
].
numel
();
tl
.
sizes
[
loc_tensor_info
]
=
tensor_lists
[
0
][
t
].
numel
();
// skip empty tensors
if
(
tl
.
sizes
[
loc_tensor_info
]
==
0
)
{
continue
;
}
for
(
int
d
=
0
;
d
<
depth
;
d
++
)
{
for
(
int
d
=
0
;
d
<
depth
;
d
++
)
{
if
(
tensor_lists
[
d
][
t
].
is_sparse
())
{
if
(
tensor_lists
[
d
][
t
].
is_sparse
())
{
at
::
Tensor
dst
=
at
::
zeros
(
tensor_lists
[
d
][
t
].
sizes
(),
tensor_lists
[
d
][
t
].
options
().
layout
(
at
::
kStrided
));
at
::
Tensor
dst
=
at
::
zeros
(
tensor_lists
[
d
][
t
].
sizes
(),
tensor_lists
[
d
][
t
].
options
().
layout
(
at
::
kStrided
));
...
...
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