class_docstr: A helper class to manage the process group mesh. It only describes how to organize process groups, and it's decoupled with parallel method.
  It just initialize process groups and cache them. The parallel method should manage them and use them to do the parallel computation.
  
  We use a ND-tuple to represent the process group mesh. And a ND-coordinate is to represent each process.
  For example, ``(0, 1, 0)`` represents the process whose rank is 2 in a 3D process group mesh with size ``(2, 2, 2)``.
  
  Args:
      *size (int): The size of each dimension of the process group mesh. The product of the size must be equal to the world size.
  
  Attributes:
      shape (Tuple[int, ...]): The shape of the process group mesh.
      rank (int): The rank of the current process.
docstr: Convert a rank to a coordinate.
  
  Args:
      rank (int): Rank to be converted.
      shape (Tuple[int, ...]): Shape of the process group mesh.
  
  Returns:
      Tuple[int, ...]: Coordinate of the rank.
docstr_tok: ["Convert","a","rank","to","a","coordinate",".","Args",":","rank","(","int",")",":","Rank","to","be","converted",".","shape","(","Tuple","[","int",",","...","]",")",":","Shape","of","the","process","group","mesh",".","Returns",":","Tuple","[","int",",","...","]",":","Coordinate","of","the","rank","."]
code: def unravel(rank: int, shape: Tuple[int, ...]) -> Tuple[int, ...]:
      """Convert a rank to a coordinate.
  
      Args:
          rank (int): Rank to be converted.
          shape (Tuple[int, ...]): Shape of the process group mesh.
  
      Returns:
          Tuple[int, ...]: Coordinate of the rank.
      """
      return np.unravel_index(rank, shape)
  
imports: import gc
  import itertools
  from functools import reduce
  from operator import mul
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch.distributed
  from torch.distributed import ProcessGroup
label_desc: Use image node_id 7 for calling the ProcessGroupMesh obj's underlying member method code with example usage: obj.unravel(rank, shape) and returns: np