class_docstr: Crossview Transformer encoder layer.
  
  The encoder architecture for each view is as follows:
  Layer norm
  cross attention (out projection weights are initialized with zeros)
  residual connection
  Layer norm
  self attention (initialized with pretrained ViT weights)
  residual connection
  Layer norm
  MLP (initialized with pretrained ViT weights)
  residual connection
  
  We apply cross attention in a sequential fashion and limit it to only take
  place in neighboring views. For example, view[i-1] is used as the query and
  view[i] is used as key and value. This design is based on the assumption
  that the tubelet sizes grow from 0th view to the nth view. We initialize cross
  attention's weights with zeros and self attention and MLP weights are
  initialized with pretrained ViTs.
  
  Attributes:
    view_configs: Model configs for each view (e.g., num_heads, mlp_dim, etc).
    cross_view_fusion: Cross view fusion config.
    dtype: The dtype of the computation (default: float32).
    dropout_rate: Dropout rate.
    attention_dropout_rate: Dropout for attention heads.
    stochastic_depth: probability of dropping a layer linearly grows from 0 to
      the provided value.
  
  Returns:
    output after transformer encoder block.
docstr: Returns the stochastic depth rate for the current layer and view.
docstr_tok: ["Returns","the","stochastic","depth","rate","for","the","current","layer","and","view","."]
code: def _get_stochastic_depth_rate(self, cur_layer, view_idx):
      """Returns the stochastic depth rate for the current layer and view."""
      max_layer = max(self.view_configs[view_idx]["num_layers"] - 1, 1)
      return (cur_layer / max_layer) * self.stochastic_depth
  
imports: import functools
  from typing import Any, List, Sequence, Tuple, Union
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  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.mtv import model_utils
  from scenic.projects.vivit import model
  from scenic.train_lib import train_utils
label_desc: Use image node_id 1 for calling the CrossViewAttentionEncoderBlock obj's underlying member method code with example usage: obj._get_stochastic_depth_rate(cur_layer, view_idx) and returns: unknown