class_docstr: Test Transformer Encoder
class_docstr_tok: ["Test","Transformer","Encoder"]
code: def test_transformer_encoder(self):
      dummy_x = torch.rand(2, 4)
      mode = TransformerEncoder(
          d_model=4,
          n_head=1,
          dim_ff=1,
          dropout=0.0,
          num_layers=1,
          num_frames=2,
      )
      out = mode(dummy_x)
      self.assertTrue(out.shape == (2, 2, 4))
  
imports: import unittest
  import torch
  from towhee.models.layers.transformer_encoder import TransformerEncoder
label_desc: Use image node_id 1 for calling the TransformerEncoderTest obj's underlying member method code with example usage: obj.test_transformer_encoder() without return types