class_docstr: A wrapper for transparently flattening a Module's parameters.
  
  Compared to the original implementation [1], this version:
  - removes tracing
  - supports shared parameters
  - handles state_dict/load_state_dict transparently
  - is renamed to FlattenParamsWrapper
  - refactored to use the FlatParameter class
  - extended to support flattening multiple groups of params (useful
    when different groups of params need different hyperparameters, like
    learning rate or weight decay)
  
  [1] https://github.com/SsnL/PyTorch-Reparam-Module
  
  Args:
      module (nn.Module):
          The module to wrap.
      param_list (Optional[List[List[nn.Parameter]]]):
          Only flatten parameters appearing in the given groups.
          If the param_list is an empty list, then no parameters will get flattened.
          Note, if a single param is in one of the list, it still get flattened and the
          original param is removed and replaced with the flatten one.
          Default: None, flatten all parameters (if any)
      flat_param_names (Optional[List[str]]):
          originally, give each flat_param a unique name. Note a "flat_param_"
          prefix will be added to those names.
class_docstr_tok: ["A","wrapper","for","transparently","flattening","a","Module","'s","parameters",".","Compared","to","the","original","implementation","[","1","]",",","this","version",":","-","removes","tracing","-","supports","shared","parameters","-","handles","state_dict\/load_state_dict","transparently","-","is","renamed","to","FlattenParamsWrapper","-","refactored","to","use","the","FlatParameter","class","-","extended","to","support","flattening","multiple","groups","of","params","(","useful","when","different","groups","of","params","need","different","hyperparameters",",","like","learning","rate","or","weight","decay",")","[","1","]","https",":","\/\/github.com\/SsnL\/PyTorch-Reparam-Module","Args",":","module","(","nn.Module",")",":","The","module","to","wrap",".","param_list","(","Optional","[","List","[","List","[","nn.Parameter","]","]","]",")",":","Only","flatten","parameters","appearing","in","the","given","groups",".","If","the","param_list","is","an","empty","list",",","then","no","parameters","will","get","flattened",".","Note",",","if","a","single","param","is","in","one","of","the","list",",","it","still","get","flattened","and","the","original","param","is","removed","and","replaced","with","the","flatten","one",".","Default",":","None",",","flatten","all","parameters","(","if","any",")","flat_param_names","(","Optional","[","List","[","str","]","]",")",":","originally",",","give","each","flat_param","a","unique","name",".","Note","a","``","flat_param_","''","prefix","will","be","added","to","those","names","."]
docstr: Unlike ``_unflatten_params``, this function unflatten into views and keep
  self.flat_param unchanged.
docstr_tok: ["Unlike","``","_unflatten_params","``",",","this","function","unflatten","into","views","and","keep","self.flat_param","unchanged","."]
code: def _unflatten_params_as_views(self) -> None:
      """Unlike ``_unflatten_params``, this function unflatten into views and keep
      self.flat_param unchanged.
      """
      assert self.is_flattened
      ps = self.get_param_views()
      param_views = []
      for (_, m, n), p in zip(self._param_infos, ps):
          setattr(m, n, p)  # This will set as plain attr
          param_views.append(p)
  
      # Save param views for easy access if anyone still wants to access
      # parameters of the module.
      setattr(self._fpw_module, "_unflattened_param_views", param_views)
  
      for _, _, m, n, shared_m, shared_n in self._shared_param_infos:
          setattr(m, n, getattr(shared_m, shared_n))
  
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 9 for calling the FlattenParamsWrapper obj's underlying member method code with example usage: obj._unflatten_params_as_views() without return types