class_docstr: A suite of tests for profile directed typing in TorchScript.
class_docstr_tok: ["A","suite","of","tests","for","profile","directed","typing","in","TorchScript","."]
code: def test_multiple_class_with_same_method(self):
      class PDTModelOne:
          def test_find(self, a, b):
              return b in a.keys()
  
      class PDTModelTwo:
          def test_find(self, a, b):
              return b in a
  
      make_global(PDTModelOne, PDTModelTwo)
      pdt_model_one = PDTModelOne()
      pdt_model_two = PDTModelTwo()
      dict_inp: List[Tuple[Any, ...]] = [
          (
              {
                  1.2: True,
                  2.3: False,
              },
              1.2,
          ),
      ]
      list_inp: List[Tuple[Any, ...]] = [
          (
              [
                  "abc",
                  "b",
              ],
              "c",
          ),
      ]
      scripted_pdt_model_one = torch.jit.script(
          PDTModelOne,
          example_inputs={pdt_model_one.test_find: dict_inp},
      )
      scripted_pdt_model_two = torch.jit.script(
          PDTModelTwo,
          example_inputs={pdt_model_two.test_find: list_inp},
      )
  
      script_model_one, script_model_two = (
          scripted_pdt_model_one(),
          scripted_pdt_model_two(),
      )
      self.assertEqual(
          script_model_one.test_find(
              {
                  1.1: True,
                  2.2: True,
                  3.3: False,
              },
              4.4,
          ),
          pdt_model_one.test_find(
              {
                  1.1: True,
                  2.2: True,
                  3.3: False,
              },
              4.4,
          ),
      )
      self.assertEqual(
          script_model_two.test_find(
              [
                  "hello",
                  "world",
              ],
              "world",
          ),
          pdt_model_two.test_find(
              [
                  "hello",
                  "world",
              ],
              "world",
          ),
      )
  
imports: import os
  import sys
  import torch
  from torch.testing._internal.jit_utils import JitTestCase, make_global
  from torch.jit._monkeytype_config import _IS_MONKEYTYPE_INSTALLED
  from typing import List, Dict, Tuple, Any, Optional, NamedTuple
  from torch.testing._internal.common_utils import NoTest
label_desc: Use image node_id 8 for calling the TestPDT obj's underlying member method code with example usage: obj.test_multiple_class_with_same_method() and returns: unknown, unknown