class_docstr: Audio Video Transformer model for n-way classification.
class_docstr_tok: ["Audio","Video","Transformer","model","for","n-way","classification","."]
code: def build_flax_model(self) -> nn.Module:
      assert (
          self.config.model.attention_config.get("type", "spacetime")
          != "factorized_encoder"
      ), "Other attention types not supported."
      model_dtype = getattr(
          jnp, self.config.get("model_dtype_str", "float32")
      )
      return MBT(
          num_classes=self.dataset_meta_data["num_classes"],
          modality_fusion=self.config.model.modality_fusion,
          fusion_layer=self.config.model.fusion_layer,
          use_bottleneck=self.config.model.get("use_bottleneck", False),
          test_with_bottlenecks=self.config.model.get(
              "test_with_bottlenecks", True
          ),
          n_bottlenecks=self.config.model.get("n_bottlenecks", 4),
          share_encoder=self.config.model.get("share_encoder", False),
          mlp_dim=self.config.model.mlp_dim,
          num_layers=self.config.model.num_layers,
          num_heads=self.config.model.num_heads,
          representation_size=self.config.model.representation_size,
          patches=self.config.model.patches,
          hidden_size=self.config.model.hidden_size,
          temporal_encoding_config=self.config.model.temporal_encoding_config,
          attention_config=self.config.model.attention_config,
          classifier=self.config.model.classifier,
          dropout_rate=self.config.model.get("dropout_rate", 0.1),
          attention_dropout_rate=self.config.model.get(
              "attention_dropout_rate", 0.1
          ),
          stochastic_droplayer_rate=self.config.model.get(
              "stochastic_droplayer_rate", 0
          ),
          return_prelogits=self.config.model.get(
              "return_prelogits", False
          ),
          dtype=model_dtype,
      )
  
imports: import functools
  from typing import Any, Callable, Dict, Optional, Sequence, Tuple
  from absl import logging
  import flax.linen
  from flax.linen.linear import default_kernel_init
  from immutabledict import immutabledict
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import classification_model
  from scenic.model_lib.base_models import model_utils
  from scenic.model_lib.base_models.classification_model import ClassificationModel
  from scenic.model_lib.layers import attention_layers
  from scenic.model_lib.layers import nn_layers
  from scenic.projects.baselines import vit
  from scenic.projects.mbt import model_utils
label_desc: Use image node_id 1 for calling the MBTClassificationModel obj's underlying member method code with example usage: obj.build_flax_model() and returns: MBT