class_docstr: Private class defines non-distributed computation model for code compatibility with other distributed models.
class_docstr_tok: ["Private","class","defines","non-distributed","computation","model","for","code","compatibility","with","other","distributed","models","."]
code: def new_group(self, ranks: List[int], **kwargs: Any) -> Any:
      if isinstance(ranks, list) and all(
          isinstance(item, int) for item in ranks
      ):
          return self._do_new_group(ranks, **kwargs)
      else:
          raise ValueError("Argument ranks should be list of int")
  
imports: from abc import ABCMeta, abstractmethod
  from numbers import Number
  from typing import Any, Callable, cast, List, Optional, Union
  import torch
  from packaging.version import Version
label_desc: Use image node_id 24 for calling the _SerialModel obj's underlying member method code with example usage: obj.new_group(ranks) and returns: self