code: def test_test_encoding_shape(self):
      with skip_if_downloading_fails():
          # test 2D encoder
          text_encoder = TextEncoder(
              spatial_dims=2,
              out_channels=32,
              encoding="clip_encoding_universal_model_32",
              pretrained=True,
          )
          text_encoding = text_encoder()
          self.assertEqual(text_encoding.shape, (32, 256, 1, 1))
  
          # test 3D encoder
          text_encoder = TextEncoder(
              spatial_dims=3,
              out_channels=32,
              encoding="clip_encoding_universal_model_32",
              pretrained=True,
          )
          text_encoding = text_encoder()
          self.assertEqual(text_encoding.shape, (32, 256, 1, 1, 1))
  
      # test random enbedding 3D
      text_encoder = TextEncoder(
          spatial_dims=3,
          out_channels=32,
          encoding="rand_embedding",
          pretrained=True,
      )
      text_encoding = text_encoder()
      self.assertEqual(text_encoding.shape, (32, 256, 1, 1, 1))
  
      # test random enbedding 2D
      text_encoder = TextEncoder(
          spatial_dims=2,
          out_channels=32,
          encoding="rand_embedding",
          pretrained=True,
      )
      text_encoding = text_encoder()
      self.assertEqual(text_encoding.shape, (32, 256, 1, 1))
  
imports: from __future__ import annotations
  import unittest
  from monai.networks.blocks.text_embedding import TextEncoder
  from tests.utils import skip_if_downloading_fails
label_desc: Use image node_id 1 for calling the TestTextEncoder obj's underlying member method code with example usage: obj.test_test_encoding_shape() without return types