diff --git a/source/op/pt/comm.cc b/source/op/pt/comm.cc index ce497ac62d..8dce9e7081 100644 --- a/source/op/pt/comm.cc +++ b/source/op/pt/comm.cc @@ -197,7 +197,7 @@ class Border : public torch::autograd::Function { torch::Tensor nlocal_tensor = saved_variables[6]; torch::Tensor nghost_tensor = saved_variables[7]; - torch::Tensor d_local_g1_tensor = grad_output[0]; + torch::Tensor d_local_g1_tensor = grad_output[0].contiguous(); #ifdef USE_MPI int mpi_init = 0; MPI_Initialized(&mpi_init);