docstr: Applies a function `fn` on all items in a report. Can apply to specific
  fields if `fields` parameter is passed
  
  Args:
      fn (Callable): A callable to called on each item in report
      fields (List[str], optional): Use to apply on specific fields.
          Defaults to None.
  
  Returns:
      Report: Update report after apply fn
docstr_tok: ["Applies","a","function","`","fn","`","on","all","items","in","a","report",".","Can","apply","to","specific","fields","if","`","fields","`","parameter","is","passed","Args",":","fn","(","Callable",")",":","A","callable","to","called","on","each","item","in","report","fields","(","List","[","str","]",",","optional",")",":","Use","to","apply","on","specific","fields",".","Defaults","to","None",".","Returns",":","Report",":","Update","report","after","apply","fn"]
code: def apply_fn(self, fn: Callable, fields: Optional[List[str]] = None):
      """Applies a function `fn` on all items in a report. Can apply to specific
      fields if `fields` parameter is passed
  
      Args:
          fn (Callable): A callable to called on each item in report
          fields (List[str], optional): Use to apply on specific fields.
              Defaults to None.
  
      Returns:
          Report: Update report after apply fn
      """
      for key in self.keys():
          if fields is not None and isinstance(fields, (list, tuple)):
              if key not in fields:
                  continue
          self[key] = fn(self[key])
          if isinstance(self[key], collections.abc.MutableSequence):
              for idx, item in enumerate(self[key]):
                  self[key][idx] = fn(item)
          elif isinstance(self[key], dict):
              for subkey in self[key].keys():
                  self[key][subkey] = fn(self[key][subkey])
      return self
  
imports: import collections
  import collections.abc
  import copy
  import warnings
  from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Union
  import torch
  from mmf.common.sample import detach_tensor, SampleList
label_desc: Use image node_id 9 for calling the Report obj's underlying member method code with example usage: obj.apply_fn(fn, fields) and returns: self