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_class_with_multiple_methods(self):
      class PDTModelWithManyMethods:
          def test_list_to_dict(self, a):
              new_dictionary: Dict[float, bool] = {}
              for element in a:
                  new_dictionary[element] = True
              return new_dictionary
  
          def test_substring(self, a, b):
              return b in a
  
      make_global(PDTModelWithManyMethods)
      pdt_model = PDTModelWithManyMethods()
      list_inp: List[Tuple[Any, ...]] = [
          (
              [
                  1.2,
                  2.3,
              ],
          ),
      ]
      str_inp: List[Tuple[Any, ...]] = [
          (
              "abc",
              "b",
          ),
      ]
      scripted_pdt_model = torch.jit.script(
          PDTModelWithManyMethods,
          example_inputs={
              pdt_model.test_list_to_dict: list_inp,
              pdt_model.test_substring: str_inp,
          },
      )
      script_model = scripted_pdt_model()
      self.assertEqual(
          script_model.test_list_to_dict(
              [
                  1.1,
                  2.2,
                  3.3,
              ],
          ),
          pdt_model.test_list_to_dict(
              [
                  1.1,
                  2.2,
                  3.3,
              ],
          ),
      )
      self.assertEqual(
          script_model.test_substring(
              "helloworld",
              "world",
          ),
          pdt_model.test_substring(
              "helloworld",
              "world",
          ),
      )
      self.assertEqual(
          script_model.test_substring(
              "helloworld",
              "def",
          ),
          pdt_model.test_substring(
              "helloworld",
              "def",
          ),
      )
  
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 7 for calling the TestPDT obj's underlying member method code with example usage: obj.test_class_with_multiple_methods() and returns: new_dictionary, unknown