class_docstr: This contains the data structures to track the execution order. We track
  the pre-forward order on the *first* iteration for forward prefetching
  (which thus assumes static graph) and the post-forward order on *every*
  iteration for backward prefetching (which thus does not assume static
  graph but may be provide an incorrect order).
docstr: Records ``handles`` in the post-forward order, where ``handles`` should
  be a group of handles used in the same module's forward. If ``handles``
  is empty, then it is omitted.
  
  Unlike :meth:`record_pre_forward`, this records the order *every*
  iteration with the expectation that the recorded order is reset in
  :meth:`next_iter`.
docstr_tok: ["Records","``","handles","``","in","the","post-forward","order",",","where","``","handles","``","should","be","a","group","of","handles","used","in","the","same","module","'s","forward",".","If","``","handles","``","is","empty",",","then","it","is","omitted",".","Unlike",":","meth",":","`","record_pre_forward","`",",","this","records","the","order","*","every","*","iteration","with","the","expectation","that","the","recorded","order","is","reset","in",":","meth",":","`","next_iter","`","."]
code: def record_post_forward(
      self, handle: Optional[FlatParamHandle]
  ) -> None:
      """
      Records ``handles`` in the post-forward order, where ``handles`` should
      be a group of handles used in the same module's forward. If ``handles``
      is empty, then it is omitted.
  
      Unlike :meth:`record_pre_forward`, this records the order *every*
      iteration with the expectation that the recorded order is reset in
      :meth:`next_iter`.
      """
      if not handle:
          return
      # Only record the first usage of a handles key
      if handle._post_forward_index:
          self.handles_post_forward_order.append(handle)
          return
      index = len(self.handles_post_forward_order)
      handle._post_forward_index = index
      self.handles_post_forward_order.append(handle)
  
imports: import itertools
  import warnings
  from enum import auto, Enum
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.distributed
  import torch.distributed.fsdp._traversal_utils
  import torch.nn
  from torch.distributed.fsdp._common_utils import _FSDPState, _get_param_to_fqns
  from torch.distributed.fsdp._flat_param import FlatParamHandle
label_desc: Use image node_id 6 for calling the _ExecOrderData obj's underlying member method code with example usage: obj.record_post_forward(handle) without return types