class_docstr: Tests xlnet model utils.
      
code: def test_RelativeMultiheadAttention(self):
      num_heads = 12
      head_dim = 64
  
      r_r_bias = tf.random_normal(shape=(num_heads, head_dim))
      r_w_bias = tf.random_normal(shape=(num_heads, head_dim))
  
      model = RelativeMutiheadAttention(
          r_r_bias=r_r_bias, r_w_bias=r_w_bias
      )
  
      states_h = tf.random_uniform(
          shape=(16, 32, model._hparams.hidden_dim)
      )
      pos_embed = tf.random_uniform(
          shape=(24, 32, model._hparams.hidden_dim)
      )
  
      output_h, output_g = model(states_h=states_h, pos_embed=pos_embed)
  
      self.assertEqual(
          output_h.shape, [16, 32, model._hparams.hidden_dim]
      )
      self.assertEqual(output_g, None)
  
imports: import tensorflow
  from texar.tf.modules.pretrained.xlnet_utils import PositionWiseFF, RelativePositionalEncoding, RelativeMutiheadAttention
label_desc: Use image node_id 2 for calling the XLNetModelUtilsTest obj's underlying member method code with example usage: obj.test_RelativeMultiheadAttention() without return types