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: Return a generator of views that map to the original parameters.
docstr_tok: ["Return","a","generator","of","views","that","map","to","the","original","parameters","."]
code: def get_param_views(
      self, external_data: Optional[Tensor] = None
  ) -> Iterator[Tensor]:
      """Return a generator of views that map to the original parameters."""
      # Note, self.data could be sharded, so its numel is <= to the sum.
      assert self.data.numel() <= sum(
          self._param_numels
      ), f"Incorrect internal state {self.data.numel()} vs. {sum(self._param_numels)}"
      data = external_data if external_data is not None else self
      if data.numel() != sum(self._param_numels):
          raise ValueError(
              f"Incorrect numel of supplied data: got {data.numel()} but expected {sum(self._param_numels)}"
          )
      return (
          t.view(s)
          for (t, s) in zip(
              data.split(self._param_numels), self._param_shapes
          )
      )
  
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 3 for calling the FlatParameter obj's underlying member method code with example usage: obj.get_param_views(external_data) and returns: unknown