code: def check_named_children(
      named_children: List[Tuple[str, nn.Module]],
      return_layers: Dict[str, str],
  ) -> List[str]:
      all_names = set(name for name, _ in named_children)
      invalid_names = []
      for layer in return_layers:
          if layer not in all_names:
              invalid_names.append(layer)
      return invalid_names
  
imports: import torch
  from torch import nn
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Tuple
  from typing import Optional
  from collections import OrderedDict
  from cftool.types import tensor_dict_type
  from .register import backbone_info_dict
  from .....constants import LATENT_KEY
  from .....misc.toolkit import set_requires_grad
label_desc: Use image node_id 2 for calling a global function with example usage: check_named_children(named_children, return_layers) and returns: invalid_names