class_docstr: Adds tape token to the input.
docstr: Add tape tokens.
docstr_tok: ["Add","tape","tokens","."]
code: def __call__(
      self, x: jnp.ndarray, bank: Optional[jnp.ndarray], train: bool
  ) -> Any:
      """Add tape tokens."""
      feature_size = x.shape[-1]
      logging.info("Input shape before adding tape tokens: %s", x.shape)
      # Retrieve tape tokens from a tape bank:
      # For now, we use CLS token, but we can have a separate <TAPE> token.
      # 'token' or 'gap' to generate query.
      # We use the same type as ViT classifier.
      if self.ac_config.query_type == "token":
          tape_token_query = x[:, 0]
      else:
          tape_token_query = jnp.mean(x, axis=1)
      tape_tokens, aux_output = TapeBank(
          ac_config=self.ac_config,
          features=feature_size,
          tape_init=truncated_normal_initializer(),
      )(tape_token_query, bank, not train)
      # Optionally apply an MLP with GLU activation
      if self.ac_config.get("tt_mlp_dim", 0):
          tape_tokens = MlpBlock(
              mlp_dim=self.ac_config.tt_mlp_dim,
              dropout_rate=self.ac_config.tt_dropout_rate,
              activation_fn=nn.glu,
              kernel_init=nn.initializers.xavier_uniform(),
              bias_init=nn.initializers.normal(stddev=1e-6),
          )(tape_tokens, deterministic=not train)
  
      # Concat tape tokens to the input.
      x = jnp.concatenate([x, tape_tokens], axis=1)
  
      logging.info("Input shape after adding tape tokens: %s", x.shape)
      return x, aux_output
  
imports: from typing import Any, Callable, Optional, Sequence, Tuple
  from absl import logging
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib.layers import nn_layers
label_desc: Use image node_id 1 for calling the AddTapeToken obj's underlying member method code with example usage: obj.__call__(x, bank, train) and returns: x,  aux_output