class_docstr: Basic ViT + T5 vision language model.
class_docstr_tok: ["Basic","ViT","+","T5","vision","language","model","."]
code: def get_base_encoded(
      self,
      image=None,
      text_tokens=None,
      train=False,
      random_drop_image=False,
      bsz=None,
      frozen_base=True,
  ):
      if bsz is None:
          if text_tokens is not None:
              bsz = len(text_tokens)
          elif image is not None:
              bsz = len(image)
      if text_tokens is not None:
          text_query, text_mask = self.text_encoder(
              encoder_input_tokens=text_tokens,
              use_dropout=train,
              frozen_base=frozen_base,
          )  # B×I×d
      else:
          text_query = jnp.zeros([bsz, 1, self.ndim], dtype=self.dtype)
          text_mask = jnp.zeros([bsz, 1], dtype=self.dtype)
      if image is not None:
          img_query, img_emb = self.encode_image(image, train=train)
          n_img_tokens = img_query.shape[1]
      else:
          n_img_tokens = 1
          img_query = jnp.zeros(
              [bsz, n_img_tokens, self.ndim], dtype=self.dtype
          )
          img_emb = jnp.zeros([bsz, self.ndim], dtype=self.dtype)
      if train and random_drop_image:
          image_mask = jax.random.bernoulli(
              self.make_rng("dropout"), p=1 - 0.2, shape=(bsz, 1)
          ).astype(self.dtype)
          img_emb = img_emb * image_mask
          image_mask = jnp.repeat(
              image_mask, repeats=n_img_tokens, axis=1
          )
      else:
          image_mask = jnp.ones([bsz, n_img_tokens], dtype=self.dtype)
      base_masks = jnp.concatenate([text_mask, image_mask], axis=1)
      return [text_query, img_query], base_masks, img_emb
  
imports: from typing import Any, Dict, Optional
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib.base_models import base_model
  from scenic.projects.knowledge_visual_language.models import constants
  from scenic.projects.knowledge_visual_language.models import layers
  from scenic.projects.knowledge_visual_language.models import losses
  from scenic.projects.knowledge_visual_language.models import metrics
  from scenic.projects.knowledge_visual_language.models import vit
  from scenic.projects.t5 import layers
  from scenic.projects.t5 import model
label_desc: Use image node_id 2 for calling the VisionLanguageModule obj's underlying member method code with example usage: obj.get_base_encoded(image, text_tokens, train, random_drop_image, bsz, frozen_base) and returns: list,  base_masks,  img_emb