code: def tree_map_hf(fn: Any, pytree: Any):
      flat_args, spec = tree_flatten_hf(pytree)
      return tree_unflatten([fn(i) for i in flat_args], spec)
  
file_path: colossalai/colossalai/pipeline/schedule/_utils.py
imports: from collections import OrderedDict
  from typing import Any, List, Optional, Tuple
  import torch
  import torch.cuda
  from torch.nn import Module
  from torch.utils._pytree import SUPPORTED_NODES, TreeSpec, _register_pytree_node, tree_flatten, tree_map, tree_unflatten
label_desc: Use image node_id 3 for calling a global function with example usage: tree_map_hf(fn, pytree) and returns: tree_unflatten