code: def test_multi_scale_transformer_block(self):
      # Change of output dimension.
      block = MultiScaleBlock(10, 20, 2)
      seq_len = 21
      c_dim = 10
      batch_dim = 8
      fake_input = torch.rand(batch_dim, seq_len, c_dim)
      input_shape = (2, 2, 5)
      output, output_shape = block(fake_input, input_shape)
      gt_shape_tensor = torch.rand(8, seq_len, 20)
      self.assertTrue(output.shape == gt_shape_tensor.shape)
      self.assertTrue(output_shape == input_shape)
  
      # Test pooling.
      block = MultiScaleBlock(10, 20, 2, stride_q=(2, 2, 1))
      c_dim = 10
      batch_dim = 8
      fake_input = torch.rand(batch_dim, seq_len, c_dim)
      input_shape = [2, 2, 5]
      output, output_shape = block(fake_input, input_shape)
      gt_shape_tensor = torch.rand(
          8, int((seq_len - 1) / 2 / 2) + 1, 20
      )
      gt_out_shape = [1, 1, 5]
      self.assertTrue(output.shape == gt_shape_tensor.shape)
      self.assertTrue(output_shape == gt_out_shape)
  
imports: import unittest
  import torch
  from towhee.models.layers.multi_scale_transformer_block import MultiScaleBlock
label_desc: Use image node_id 1 for calling the MultiScaleTransformerBlockTest obj's underlying member method code with example usage: obj.test_multi_scale_transformer_block() without return types