code: def fqn_to_module(
      model: Optional[nn.Module], path: str
  ) -> Optional[nn.Module]:
      """
      Given an fqn, returns the corresponding module or tensor or None if the fqn given by `path`
      doesn't correspond to anything. Similar to model.get_submodule(path) but works for tensors.
      """
      if path != "":
          for name in path.split("."):
              model = getattr(model, name, None)
      return model
  
file_path: pytorch/torch/ao/pruning/sparsifier/utils.py
imports: from typing import Any, Dict, Optional, Type
  from torch.nn.utils.parametrize import type_before_parametrizations, is_parametrized
  from itertools import chain
  from torch import nn
label_desc: Use image node_id 4 for calling a global function with example usage: fqn_to_module(model, path) and returns: model