code: def test_validate_tr_rank(rank1, rank2):
      tensor_shape = tuple(np.random.randint(1, 100, size=4))
      n_param_tensor = np.prod(tensor_shape)
  
      # Rounding = floor
      rank = ivy.TRTensor.validate_tr_rank(
          tensor_shape, rank="same", rounding="floor"
      )
      n_param = ivy.TRTensor.tr_n_param(tensor_shape, rank)
      assert n_param <= n_param_tensor
  
      # Rounding = ceil
      rank = ivy.TRTensor.validate_tr_rank(
          tensor_shape, rank="same", rounding="ceil"
      )
      n_param = ivy.TRTensor.tr_n_param(tensor_shape, rank)
      assert n_param >= n_param_tensor
  
      # Integer rank
      with np.testing.assert_raises(ValueError):
          ivy.TRTensor.validate_tr_rank(tensor_shape, rank=rank1)
  
      with np.testing.assert_raises(ValueError):
          ivy.TRTensor.validate_tr_rank(tensor_shape, rank=rank2)
  
imports: import ivy
  import numpy
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_validate_tr_rank(rank1, rank2) without return types