code: def test_triangular_solve_transpose(upper):
      b = torch.randn(5, 6)
      A = torch.randn(5, 5)
      expected = torch.triangular_solve(
          b, A, upper=upper, transpose=True
      ).solution
      actual = torch.linalg.solve_triangular(A.T, b, upper=not upper)
      assert_close(actual, expected)
      A = A.triu() if upper else A.tril()
      assert_close(A.T @ actual, b)
  
imports: import pytest
  import torch
  from pyro.ops.linalg import rinverse
  from tests.common import assert_close, assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_triangular_solve_transpose(upper) without return types