class_docstr: Dense video captioning module that encodes a video and generate tokens.
code: def __call__(
      self,
      encoder_inputs,
      decoder_inputs,
      *,
      train=True,
      decode=False,
      max_decode_length=None,
      debug: bool = False,
  ):
      if debug:
          logging.info("encoder_inputs: %s", encoder_inputs)
          logging.info("decoder_inputs: %s", decoder_inputs)
      encoded = self.encode(encoder_inputs, train=train)
      # Fill in encoder_input_tokens if not provided.
      # This sets the all output embeddings to be valid inputs.
      if self.config.encoder.encoder_type in [
          "t5_encoder",
          "cat_encoder",
      ]:
          decoder_inputs["encoder_input_tokens"] = encoded["mask"]
          encoded = encoded["encoded"]
      else:
          if "encoder_input_tokens" not in decoder_inputs:
              decoder_inputs["encoder_input_tokens"] = jnp.ones(
                  encoded.shape[:-1]
              )  # pytype: disable=attribute-error
  
      # joint time and text
      return {
          "logits": self.decode(
              encoded,
              decoder_inputs,
              train=train,
              decode=decode,
              max_decode_length=max_decode_length,
          ),
          "encoded": encoded,
      }
  
imports: import functools
  from typing import Any, Dict, Mapping, Optional, Tuple
  from absl import logging
  import flax.linen
  from flax.training import common_utils
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.baselines import vit
  from scenic.projects.t5 import layers
  from scenic.projects.t5 import model
  from t5x import decoding
  from t5x.models import DecodeFnCallable
label_desc: Use image node_id 6 for calling the DenseVideoCaptioningModule obj's underlying member method code with example usage: obj.__call__(encoder_inputs, decoder_inputs) and returns: dict