code: def validate_tt_tensor(tt_tensor):
      factors = tt_tensor
      n_factors = len(factors)
  
      if isinstance(tt_tensor, TTTensor):
          return tt_tensor.shape, tt_tensor.rank
      elif isinstance(tt_tensor, (float, int)):
          return 0, 0
  
      rank = []
      shape = []
      for index, factor in enumerate(factors):
          current_rank, current_shape, next_rank = ivy.shape(factor)
  
          if len(ivy.shape(factor)) != 3:
              raise ValueError(
                  "TT expresses a tensor as third order factors"
                  f" (tt-cores).\nHowever, len(ivy.shape(factors[{index}])) ="
                  f" {len(ivy.shape(factor))}"
              )
  
          if index and ivy.shape(factors[index - 1])[2] != current_rank:
              raise ValueError(
                  "Consecutive factors should have matching ranks\n -- e.g."
                  " ivy.shape(factors[0])[2]) == ivy.shape(factors[1])[0])\nHowever,"
                  f" ivy.shape(factor[{index-1}])[2] =="
                  f" {ivy.shape(factors[index - 1])[2]} but"
                  f" ivy.shape(factor[{index}])[0] == {current_rank} "
              )
  
          if (index == 0) and current_rank != 1:
              raise ValueError(
                  "Boundary conditions dictate factor[0].shape[0] == 1."
                  f"However, got factor[0].shape[0] = {current_rank}."
              )
  
          if (index == n_factors - 1) and next_rank != 1:
              raise ValueError(
                  "Boundary conditions dictate factor[-1].shape[2] == 1."
                  f"However, got factor[{n_factors}].shape[2] = {next_rank}."
              )
  
          shape.append(current_shape)
          rank.append(current_rank)
  
      rank.append(next_rank)
  
      return tuple(shape), tuple(rank)
  
imports: from .base import FactorizedTensor
  import ivy
  import warnings
label_desc: Use image node_id 11 for calling the TTTensor obj's underlying member method code with example usage: obj.validate_tt_tensor(tt_tensor) and returns: tuple,  tuple, tt_tensor,  tt_tensor, int,  int