class_docstr: A parameter that is initialized from a list of parameters and can be
  turned into a list of views as needed.
class_docstr_tok: ["A","parameter","that","is","initialized","from","a","list","of","parameters","and","can","be","turned","into","a","list","of","views","as","needed","."]
docstr: Initialize the _param_numels and _param_shapes lists.
docstr_tok: ["Initialize","the","_param_numels","and","_param_shapes","lists","."]
code: def __init__(
      self, params: Sequence[nn.Parameter], requires_grad: bool = True
  ):
      """Initialize the _param_numels and _param_shapes lists."""
      self._param_numels = [p.numel() for p in params]
      assert self.numel() <= sum(
          self._param_numels
      ), f"Something wrong with __new__ method, {self.numel()} vs. {sum(self._param_numels)}"
      self._param_shapes = [p.size() for p in params]
  
      # These are set by FPW class below, not by this class itself.
      self._param_infos: List[Tuple[str, nn.Module, str]] = []
      self._shared_param_infos: List[
          Tuple[str, str, nn.Module, str, nn.Module, str]
      ] = []
  
imports: from contextlib import contextmanager
  from itertools import chain
  import typing
  from typing import TYPE_CHECKING, Any, Dict, Generator, Iterator, List, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, Union, cast
  import torch
  from torch import Tensor
  import torch.nn
  from fairscale.internal.state_dict import replace_by_prefix_
label_desc: Use image node_id 2 to create a new FlatParameter object from inherited base classes: nn with example: obj = FlatParameter(params, requires_grad)