code: def tridiagonal_solve(
      diagonals,
      rhs,
      diagonals_format="compact",
      transpose_rhs=False,
      conjugate_rhs=False,
      name=None,
      partial_pivoting=True,
      perturb_singular=False,
  ):
      if transpose_rhs is True:
          rhs_copy = ivy.matrix_transpose(rhs)
      if conjugate_rhs is True:
          rhs_copy = ivy.conj(rhs)
      if not transpose_rhs and not conjugate_rhs:
          rhs_copy = ivy.array(rhs)
  
      if diagonals_format == "matrix":
          return ivy.solve(diagonals, rhs_copy)
      elif diagonals_format in ["sequence", "compact"]:
          diagonals = ivy.array(diagonals)
          dim = diagonals[0].shape[0]
          diagonals[[0, -1], [-1, 0]] = 0
          dummy_idx = [0, 0]
          indices = ivy.array(
              [
                  [(i, i + 1) for i in range(dim - 1)] + [dummy_idx],
                  [(i, i) for i in range(dim)],
                  [dummy_idx] + [(i + 1, i) for i in range(dim - 1)],
              ]
          )
          constructed_matrix = ivy.scatter_nd(
              indices, diagonals, shape=ivy.array([dim, dim])
          )
          return ivy.solve(constructed_matrix, rhs_copy)
      else:
          raise ValueError("Unexpected diagonals_format")
  
imports: import ivy
  from ivy.functional.frontends.tensorflow import check_tensorflow_casting
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.tensorflow.func_wrapper import to_ivy_arrays_and_back, handle_tf_dtype
  import ivy.functional.frontends.tensorflow
label_desc: Use image node_id 36 for calling a global function with example usage: tridiagonal_solve(diagonals, rhs, diagonals_format, transpose_rhs, conjugate_rhs, name, partial_pivoting, perturb_singular) and returns: ivy, ivy