Platforms: linux

This test was disabled because it is failing on master ([recent examples](http://torch-ci.com/failure/test_torch.py%3A%3ATestTorch%3A%3Atest_equal)).

The cause seems to point to https://github.com/pytorch/pytorch/pull/100024 (or D45282119 as it was landed internally)

cc @mruberry @houseroad @ezyang 
self.assertEqual(len(w), 1)
        
        with warnings.catch_warnings(record=True) as w:
            scripted_cpp_warn_fn = torch.jit.script(cpp_warn_fn)
            scripted_cpp_warn_fn()
            warning = w[0]
            
            escaped_warning_message = str(warning.message).encode('unicode_escape')
            self.assertTrue(re.search(s, repr(escaped_warning_message), re.IGNORECASE) is not None)
            
            
            
            
            self.assertEqual(len(w), 1)
        
        def warn_fn():
            warnings.warn("Warning!")
        
        with warnings.catch_warnings(record=True) as w:
            scripted_warn_fn = torch.jit.script(warn_fn)
            scripted_warn_fn()
            frameinfo = inspect.getframeinfo(inspect.currentframe())
            warning = w[0]
            self.assertTrue(re.search('Warning!', str(warning.message)) is not None)
            
            self.assertEqual(frameinfo.lineno - 6, warning.lineno)
            self.assertEqual(len(w), 1)
    
    @onlyCPU
    def test_warn_always_caught(self, d):