torch/lib/c10d/ProcessGroupMPI.cpp
// Checking the input tensor's validity
Checking the input tensor's validity
Checking the input tensor ' s validity
void checkSingleTensor(const std::vector<at::Tensor>& tensors) {
  if (tensors.size() != 1) {
    throw std::runtime_error(
        "MPI process group only supports a single "
        "tensor op");
  }
  if (!tensors[0].is_contiguous()) {
    throw std::runtime_error("input tensor has to be contiguous");
  }
  if (tensors[0].is_cuda() && !cudaAwareMpiCheck()) {
    throw std::runtime_error(
        "CUDA tensor detected and the MPI used doesn't "
        "have CUDA-aware MPI support");
  }
}
void checkSingleTensor ( const std :: vector < at :: Tensor > & tensors ) { if ( tensors . size ( ) != 1 ) { throw std :: runtime_error ( " " " " ) ; } if ( ! tensors [ 0 ] . is_contiguous ( ) ) { throw std :: runtime_error ( " " ) ; } if ( tensors [ 0 ] . is_cuda ( ) && ! cudaAwareMpiCheck ( ) ) { throw std :: runtime_error ( " " " " ) ; } }
Checking the input tensor's validity
Checking the input tensor ' s validity