class_docstr: Vision Video Transformer model for masked autoencoder pretraining.
class_docstr_tok: ["Vision","Video","Transformer","model","for","masked","autoencoder","pretraining","."]
code: def build_flax_model(self) -> nn.Module:
      model_dtype = getattr(
          jnp, self.config.get("model_dtype_str", "float32")
      )
      num_classes = base_model.get_output_shapes(
          self.config.masked_feature_loss.target,
          tuple(self.config.model.patches.size),
          self.config.masked_feature_loss.select_central_frame,
      )
  
      return ViViTMaskedAutoencoder(
          num_classes=num_classes,
          mlp_dim=self.config.model.mlp_dim,
          num_layers=self.config.model.num_layers,
          num_heads=self.config.model.num_heads,
          patches=self.config.model.patches,
          hidden_size=self.config.model.hidden_size,
          token_mask_probability=(
              self.config.masked_feature_loss.token_mask_probability
          ),
          masking_strategy=self.config.masked_feature_loss.get(
              "masking_strategy", "random"
          ),
          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
          ),
          dtype=model_dtype,
          decoder_config=self.config.model.get("decoder_config", None),
          positional_embedding=self.config.model.get(
              "positional_embedding", "sinusoidal_1d"
          ),
          positional_embedding_decoder=self.config.model.get(
              "positional_embedding_decoder", "sinusoidal_1d"
          ),
          normalise_encoder_output=self.config.model.get(
              "normalise_encoder_output", True
          ),
      )
  
imports: from typing import Any, Optional
  import flax
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import classification_model
  from scenic.model_lib.layers import nn_layers
  from scenic.projects.av_mae import base_model
  from scenic.projects.av_mae import model_utils
  from scenic.projects.vivit import model
  from scenic.projects.vivit import model_utils
label_desc: Use image node_id 1 for calling the ViViTMaskedAutoencoderModel obj's underlying member method code with example usage: obj.build_flax_model() and returns: ViViTMaskedAutoencoder