Skip to content

Commit

Permalink
Unchange tensor in neighbor allreduce
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanbin Hu committed Jun 12, 2020
1 parent 144bbab commit ff22ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bluefog/torch/mpi_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ int DoNeighborAllreduce(::torch::Tensor tensor, ::torch::Tensor output,
}
}
output.resize_(shape_vector);
output.add_(tensor.mul_(self_weight));
output.add_(tensor.mul(self_weight));
} else {
auto output_reduced = output.slice(0, 0, first_dim);
for (int i = 1; i < bluefog_neighbor_size(); i++) {
Expand Down Expand Up @@ -418,7 +418,7 @@ int DoNeighborAllreduce(::torch::Tensor tensor, ::torch::Tensor output,
}
}
output.resize_(shape_vector);
output.add_(tensor.mul_(self_weight));
output.add_(tensor.mul(self_weight));
} else {
auto output_reduced = output.slice(0, 0, first_dim);
for (int i = 1; i < bluefog_neighbor_size(); i++) {
Expand Down

0 comments on commit ff22ae2

Please sign in to comment.