class_docstr: Tests xlnet model utils.
      
code: def test_RelativePositionalEncoding(self):
      batch_size = 16
      max_time = 8
      total_len = 32
  
      # Case 1
      model = RelativePositionalEncoding()
      pos_embed = model(
          batch_size=batch_size, max_time=max_time, total_len=total_len
      )
      self.assertEqual(pos_embed.shape, [40, 16, model._hparams.dim])
  
      # Case 2
      model = RelativePositionalEncoding()
      pos_embed = model(
          batch_size=batch_size,
          max_time=max_time,
          total_len=total_len,
          attn_type="uni",
      )
      self.assertEqual(pos_embed.shape, [33, 16, model._hparams.dim])
  
imports: import tensorflow
  from texar.tf.modules.pretrained.xlnet_utils import PositionWiseFF, RelativePositionalEncoding, RelativeMutiheadAttention
label_desc: Use image node_id 3 for calling the XLNetModelUtilsTest obj's underlying member method code with example usage: obj.test_RelativePositionalEncoding() without return types