class_docstr: This class is used to automatically find problematic nodes in a model. It takes a FX
  graphmodule and generate some submodules while traverse the graph. Then two functions
  `run_a` and `run_b` will be used to run the same submodule and a function `compare_fn`
  will be used to compare the results.
  
  Currently we provides two ways to traverse the graph and generate submodules.
      1. Sequential traversal: this will traverse the graph node by node and generate
         one submodule with one sigle node.
      2. Binary searching: this will do a binary search style traversal on the graph.
  
  For internal Users, a guide can be found here https://fb.quip.com/HDtuAgiKGfkP.
docstr: Tag selected nodes with tag "minimize". Nodes with the same tags will
  be split to the same submodule afterwards.
  
  Args:
      selected_nodes: Nodes that we want to minimize. We will tag those nodes
          with "minimize", all preceding nodes with "main_0" and all following
          nodes with "main_1".
code: def _tag_nodes(self, selected_nodes: NodeSet):
      """
      Tag selected nodes with tag "minimize". Nodes with the same tags will
      be split to the same submodule afterwards.
  
      Args:
          selected_nodes: Nodes that we want to minimize. We will tag those nodes
              with "minimize", all preceding nodes with "main_0" and all following
              nodes with "main_1".
      """
      for node in self.module.graph.nodes:
          if node.op not in CALLABLE_NODE_OPS:
              continue
  
          if node in selected_nodes:
              node.tag = "minimize"
          elif any(
              n.tag in {"minimize", "main_1"}
              for n in node.all_input_nodes
              if n.op in CALLABLE_NODE_OPS
          ):
              node.tag = "main_1"
          else:
              node.tag = "main_0"
  
imports: import logging
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  import torch.fx
  from torch.fx._compatibility import compatibility
  from torch.fx.node import map_arg
  from .shape_prop import ShapeProp
  from .split_utils import split_by_tags
  from .tools_common import CALLABLE_NODE_OPS, FxNetAccFusionsFinder, Names, NodeList, NodeSet, TensorOrTensors, Tensors
label_desc: Use image node_id 6 for calling the _MinimizerBase obj's underlying member method code with example usage: obj._tag_nodes(selected_nodes) without return types