class_docstr: T5 style cross-attention layer.
  
  Args:
      d_model (`int`):
          Size of the input hidden states.
      d_kv (`int`):
          Size of the key-value projection vectors.
      num_heads (`int`):
          Number of attention heads.
      dropout_rate (`float`):
          Dropout probability.
      layer_norm_epsilon (`float`):
          A small value used for numerical stability to avoid dividing by zero.
class_docstr_tok: ["T5","style","cross-attention","layer",".","Args",":","d_model","(","`","int","`",")",":","Size","of","the","input","hidden","states",".","d_kv","(","`","int","`",")",":","Size","of","the","key-value","projection","vectors",".","num_heads","(","`","int","`",")",":","Number","of","attention","heads",".","dropout_rate","(","`","float","`",")",":","Dropout","probability",".","layer_norm_epsilon","(","`","float","`",")",":","A","small","value","used","for","numerical","stability","to","avoid","dividing","by","zero","."]
code: def forward(
      self,
      hidden_states: torch.FloatTensor,
      key_value_states: Optional[torch.FloatTensor] = None,
      attention_mask: Optional[torch.FloatTensor] = None,
  ) -> torch.FloatTensor:
      normed_hidden_states = self.layer_norm(hidden_states)
      attention_output = self.attention(
          normed_hidden_states,
          encoder_hidden_states=key_value_states,
          attention_mask=attention_mask.squeeze(1),
      )
      layer_output = hidden_states + self.dropout(attention_output)
      return layer_output
  
imports: import math
  from typing import Optional, Tuple
  import torch
  from torch import nn
  from ..configuration_utils import ConfigMixin, register_to_config
  from .attention_processor import Attention
  from .embeddings import get_timestep_embedding
  from .modeling_utils import ModelMixin
label_desc: Use image node_id 2 for calling the T5LayerCrossAttention obj's underlying member method code with example usage: obj.forward(hidden_states, key_value_states, attention_mask) and returns: layer_output