code: def test_positional_emb_weights_against_roformer(self):
      desired_weights = tf.constant(
          [
              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
              [0.8415, 0.8219, 0.8020, 0.7819, 0.7617],
              [0.9093, 0.9364, 0.9581, 0.9749, 0.9870],
          ]
      )
      emb1 = TFRoFormerSinusoidalPositionalEmbedding(
          num_positions=512, embedding_dim=512
      )
      emb1([2, 16, 512])
      weights = emb1.weight[:3, :5]
  
      tf.debugging.assert_near(
          weights, desired_weights, atol=self.tolerance
      )
  
imports: import unittest
  from transformers import RoFormerConfig, is_tf_available
  from transformers.testing_utils import require_tf, slow
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
label_desc: Use image node_id 2 for calling the TFRoFormerSinusoidalPositionalEmbeddingTest obj's underlying member method code with example usage: obj.test_positional_emb_weights_against_roformer() without return types