code: def _get_return_nodes(self, model):
      set_rng_seed(0)
      exclude_nodes_filter = [
          "getitem",
          "floordiv",
          "size",
          "chunk",
          "_assert",
          "eq",
          "dim",
          "getattr",
      ]
      train_nodes, eval_nodes = get_graph_node_names(
          model,
          tracer_kwargs={"leaf_modules": self.leaf_modules},
          suppress_diff_warning=True,
      )
      # Get rid of any nodes that don't return tensors as they cause issues
      # when testing backward pass.
      train_nodes = [
          n
          for n in train_nodes
          if not any(x in n for x in exclude_nodes_filter)
      ]
      eval_nodes = [
          n
          for n in eval_nodes
          if not any(x in n for x in exclude_nodes_filter)
      ]
      return random.sample(train_nodes, 10), random.sample(
          eval_nodes, 10
      )
  
imports: import random
  from itertools import chain
  from typing import Mapping, Sequence
  import pytest
  import torch
  from common_utils import set_rng_seed
  from torchvision import models
  from torchvision.models._utils import IntermediateLayerGetter
  from torchvision.models.detection.backbone_utils import BackboneWithFPN, mobilenet_backbone, resnet_fpn_backbone
  from torchvision.models.feature_extraction import create_feature_extractor, get_graph_node_names
label_desc: Use image node_id 2 for calling the TestFxFeatureExtraction obj's underlying member method code with example usage: obj._get_return_nodes(model) and returns: random,  random