class_docstr: Implements a video+text single-tower backbone.
  
  Attributes:
    num_classes: Number of output classes.
    video_tower_config: The config of the video tower.
    text_tower_config: The config of the text tower.
    video_text_fusion_config: The config of video+text fusion.
    classifier: 'gap' or 'token'
class_docstr_tok: ["Implements","a","video+text","single-tower","backbone",".","Attributes",":","num_classes",":","Number","of","output","classes",".","video_tower_config",":","The","config","of","the","video","tower",".","text_tower_config",":","The","config","of","the","text","tower",".","video_text_fusion_config",":","The","config","of","video+text","fusion",".","classifier",":","'gap","'","or","'token","'"]
code: def setup(self):
      if self.video_tower_config.get("modality_configs") is None:
          # Ensure backward compatibility for single modality.
          self.video_encoder = encoders.ENCODERS[
              self.video_tower_config.encoder_name
          ](
              name="video_encoder",
              **self.video_tower_config.encoder_config,
          )
          if self.video_tower_config.get("projection_size"):
              self.video_projection = nn.Dense(
                  self.video_tower_config.projection_size,
                  use_bias=self.video_tower_config.get(
                      "projection_use_bias", True
                  ),
                  name="video_projection",
              )
      else:
          self.video_encoders = (
              {  # pylint: disable=g-complex-comprehension
                  modality_name: encoders.ENCODERS[
                      modality_config.encoder_name
                  ](
                      name=f"{modality_name}_encoder",
                      **modality_config.encoder_config,
                  )
                  for (
                      modality_name,
                      modality_config,
                  ) in self.video_tower_config.modality_configs.items()
              }
          )
          self.modality_ln = (
              {  # pylint: disable=g-complex-comprehension
                  modality_name: nn.LayerNorm(
                      name=f"{modality_name}_ln"
                  )
                  for (
                      modality_name,
                      _,
                  ) in self.video_tower_config.modality_configs.items()
              }
          )
          self.modality_projections = (
              {  # pylint: disable=g-complex-comprehension
                  modality_name: nn.Dense(
                      modality_config.projection_size,
                      use_bias=modality_config.get(
                          "projection_use_bias", True
                      ),
                      name=f"{modality_name}_projection",
                  )
                  for (
                      modality_name,
                      modality_config,
                  ) in self.video_tower_config.modality_configs.items()
                  if modality_config.get("projection_size")
              }
          )
          if self.video_tower_config.get("projection_size"):
              self.video_projection = nn.Dense(
                  self.video_tower_config.projection_size,
                  name="concat_video_projection",
              )
      if self.text_tower_config is not None:
          self.text_encoder = encoders.ENCODERS[
              self.text_tower_config.encoder_name
          ](
              name="text_encoder",
              **self.text_tower_config.encoder_config,
          )
          if self.text_tower_config.get("projection_size"):
              self.text_projection = nn.Dense(
                  self.text_tower_config.projection_size,
                  use_bias=self.text_tower_config.get(
                      "projection_use_bias", True
                  ),
                  name="text_projection",
              )
      self.fusion_model = video_text_fusion.FUSION_MODELS[
          self.video_text_fusion_config.type
      ](
          name="video_text_fusion",
          **self.video_text_fusion_config.config,
      )
      self.head_models = {
          head_name: heads.HEADS[head_config.type](
              name=f"{head_name}_head", **head_config.config
          )
          for head_name, head_config in self.head_config.items()
      }
  
imports: from typing import Any, Dict, Optional
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  from scenic.projects.unloc import action_segmentation_base_model
  from scenic.projects.unloc import encoders
  from scenic.projects.unloc import heads
  from scenic.projects.unloc import moment_retrieval_base_model
  from scenic.projects.unloc import temporal_localization_base_model
  from scenic.projects.unloc import video_text_fusion
label_desc: Use image node_id 1 for calling the VideoTextSingleTower obj's underlying member method code with example usage: obj.setup() without return types