code: def test_inf(self):
      @torch.jit.script
      def foo(a):
          return a < float("inf")
  
      s = torch.rand(1)
      self.assertTrue(foo(s))
  
      @torch.jit.script
      def bar(a):
          return a > float("-inf")
  
      s = torch.rand(1)
      self.assertTrue(foo(s))
  
      # test re-assignment on imported source
      str = """
          def foo(x):
              # type: (bool)
              a = float("-inf")
              if not x:
                  a = float(torch.tensor([5]))
              return a < 4
          """
      cu = torch.jit.CompilationUnit(str)
      self.assertTrue(cu.foo(True))
      self.assertFalse(cu.foo(False))
  
imports: import os
  import sys
  import tempfile
  import random
  from textwrap import dedent
  import torch
  from torch.testing._internal.jit_utils import JitTestCase, execWrapper
label_desc: Use image node_id 15 for calling the TestPythonBuiltinOP obj's underlying member method code with example usage: obj.test_inf() and returns: unknown, unknown