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_pdt_list_and_tuple(self):
      def test_list_and_tuple(a):
          return sum(a)
  
      make_global(test_list_and_tuple)
  
      scripted_fn_float_list_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[([4.9, 8.9],)]
      )
      self.assertEqual(
          scripted_fn_float_list_input([11.9, 7.6]),
          test_list_and_tuple([11.9, 7.6]),
      )
  
      scripted_fn_bool_list_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[([True, False, True],)]
      )
      self.assertEqual(
          scripted_fn_bool_list_input([True, True, True]),
          test_list_and_tuple([True, True, True]),
      )
  
      scripted_fn_int_list_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[([3, 4, 5],)]
      )
      self.assertEqual(
          scripted_fn_int_list_input([1, 2, 3]),
          test_list_and_tuple([1, 2, 3]),
      )
  
      scripted_fn_float_tuple_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[((4.9, 8.9),)]
      )
      self.assertEqual(
          scripted_fn_float_tuple_input((11.9, 7.6)),
          test_list_and_tuple((11.9, 7.6)),
      )
  
      scripted_fn_bool_tuple_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[((True, False, True),)]
      )
      self.assertEqual(
          scripted_fn_bool_tuple_input((True, True, True)),
          test_list_and_tuple((True, True, True)),
      )
  
      scripted_fn_int_tuple_input = torch.jit.script(
          test_list_and_tuple, example_inputs=[((3, 4, 5),)]
      )
      self.assertEqual(
          scripted_fn_int_tuple_input((1, 2, 3)),
          test_list_and_tuple((1, 2, 3)),
      )
  
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 10 for calling the TestPDT obj's underlying member method code with example usage: obj.test_pdt_list_and_tuple() and returns: sum