code: def test_tril_triu_with_inf(self):
      # Issue 4859
      arr = np.array([[1, 1, np.inf], [1, 1, 1], [np.inf, 1, 1]])
      out_tril = np.array([[1, 0, 0], [1, 1, 0], [np.inf, 1, 1]])
      out_triu = out_tril.T
      assert_array_equal(np.triu(arr), out_triu)
      assert_array_equal(np.tril(arr), out_tril)
  
imports: import functools
  from unittest import expectedFailure, skipIf
  import pytest
  from pytest import raises
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TEST_WITH_TORCHDYNAMO, TestCase, xpassIfTorchDynamo
label_desc: Use image node_id 4 for calling the TestTri obj's underlying member method code with example usage: obj.test_tril_triu_with_inf() without return types