docstr: Infer a ConcreteType from this `nn.Module` instance. Underlying JIT types are re-used if possible.
docstr_tok: ["Infer","a","ConcreteType","from","this","`","nn.Module","`","instance",".","Underlying","JIT","types","are","re-used","if","possible","."]
code: def get_or_create_concrete_type(self, nn_module):
      """Infer a ConcreteType from this `nn.Module` instance. Underlying JIT types are re-used if possible."""
      concrete_type_builder = infer_concrete_type_builder(nn_module)
  
      nn_module_type = type(nn_module)
      if nn_module_type not in self.type_store:
          self.type_store[nn_module_type] = []
  
      # Search the type store for an already-available JIT type
      known_types = self.type_store[nn_module_type]
      for known_type in known_types:
          if known_type.equals(concrete_type_builder):
              return known_type
  
      # We didn't find anything; generate a new JIT type from this concrete type
      concrete_type = concrete_type_builder.build()
      self.type_store[nn_module_type].append(concrete_type)
      return concrete_type
  
imports: import collections
  import functools
  import inspect
  import sys
  import textwrap
  import types
  import warnings
  from typing import Dict, List, Set, Type
  import torch
  import torch._jit_internal
  from torch._sources import fake_range
  from torch.jit._builtins import _find_builtin
  from torch.jit._check import AttributeTypeIsSupportedChecker
  from torch.jit._state import _add_script_class, _get_script_class, _python_cu
  from torch.jit.frontend import get_class_properties, get_default_args, get_jit_class_def, get_jit_def
  from torch.nn import Module
label_desc: Use image node_id 2 for calling the ConcreteTypeStore obj's underlying member method code with example usage: obj.get_or_create_concrete_type(nn_module) and returns: concrete_type, known_type