code: def validate_tr_rank(tensor_shape, rank="same", rounding="round"):
      if rounding == "ceil":
          rounding_fun = ivy.ceil
      elif rounding == "floor":
          rounding_fun = ivy.floor
      elif rounding == "round":
          rounding_fun = ivy.round
      else:
          raise ValueError(
              f"Rounding should be round, floor or ceil, but got {rounding}"
          )
  
      if rank == "same":
          rank = float(1)
  
      n_dim = len(tensor_shape)
      if n_dim == 2:
          warnings.warn(
              "Determining the TR-rank for the trivial case of a matrix"
              f" (order 2 tensor) of shape {tensor_shape}, not a higher-order tensor."
          )
  
      if isinstance(rank, float):
          # Choose the *same* rank for each mode
          n_param_tensor = ivy.prod(tensor_shape) * rank
  
          # R_k I_k R_{k+1} = R^2 I_k
          solution = int(
              rounding_fun(
                  ivy.sqrt(n_param_tensor / ivy.sum(tensor_shape))
              )
          )
          rank = (solution,) * (n_dim + 1)
  
      else:
          # Check user input for potential errors
          n_dim = len(tensor_shape)
          if isinstance(rank, int):
              rank = (rank,) * (n_dim + 1)
          elif n_dim + 1 != len(rank):
              message = (
                  "Provided incorrect number of ranks. Should verify len(rank) =="
                  f" len(tensor.shape)+1, but len(rank) = {len(rank)} while"
                  f" len(tensor.shape)+1 = {n_dim + 1}"
              )
              raise ValueError(message)
  
          # Check first and last rank
          if rank[0] != rank[-1]:
              message = (
                  f"Provided rank[0] == {rank[0]} and rank[-1] == {rank[-1]}"
                  " but boundary conditions dictate rank[0] == rank[-1]"
              )
              raise ValueError(message)
  
      return list(rank)
  
imports: from .base import FactorizedTensor
  import ivy
  import warnings
label_desc: Use image node_id 15 for calling the TRTensor obj's underlying member method code with example usage: obj.validate_tr_rank(tensor_shape, rank, rounding) and returns: list