Unverified Commit 297ab210 authored by Jeff Daily's avatar Jeff Daily Committed by GitHub
Browse files

in multi tensor apply, skip empty tensors (#54)

parent e57c84e0
...@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment