class_docstr: RWKV decoder module.
  
  Based on https://arxiv.org/pdf/2305.13048.pdf.
  
  Args:
      vocab_size: Vocabulary size.
      block_size: Input/Output size.
      context_size: Context size for WKV computation.
      linear_size: FeedForward hidden size.
      attention_size: SelfAttention hidden size.
      normalization_type: Normalization layer type.
      normalization_args: Normalization layer arguments.
      num_blocks: Number of RWKV blocks.
      rescale_every: Whether to rescale input every N blocks (inference only).
      embed_dropout_rate: Dropout rate for embedding layer.
      att_dropout_rate: Dropout rate for the attention module.
      ffn_dropout_rate: Dropout rate for the feed-forward module.
      embed_pad: Embedding padding symbol ID.
class_docstr_tok: ["RWKV","decoder","module",".","Based","on","https",":","\/\/arxiv.org\/pdf\/2305.13048.pdf",".","Args",":","vocab_size",":","Vocabulary","size",".","block_size",":","Input\/Output","size",".","context_size",":","Context","size","for","WKV","computation",".","linear_size",":","FeedForward","hidden","size",".","attention_size",":","SelfAttention","hidden","size",".","normalization_type",":","Normalization","layer","type",".","normalization_args",":","Normalization","layer","arguments",".","num_blocks",":","Number","of","RWKV","blocks",".","rescale_every",":","Whether","to","rescale","input","every","N","blocks","(","inference","only",")",".","embed_dropout_rate",":","Dropout","rate","for","embedding","layer",".","att_dropout_rate",":","Dropout","rate","for","the","attention","module",".","ffn_dropout_rate",":","Dropout","rate","for","the","feed-forward","module",".","embed_pad",":","Embedding","padding","symbol","ID","."]
docstr: Encode source label sequences.
  
  Args:
      labels: Decoder input sequences. (B, L)
  
  Returns:
      out: Decoder output sequences. (B, U, D_dec)
docstr_tok: ["Encode","source","label","sequences",".","Args",":","labels",":","Decoder","input","sequences",".","(","B",",","L",")","Returns",":","out",":","Decoder","output","sequences",".","(","B",",","U",",","D_dec",")"]
code: def forward(self, labels: torch.Tensor) -> torch.Tensor:
      """Encode source label sequences.
  
      Args:
          labels: Decoder input sequences. (B, L)
  
      Returns:
          out: Decoder output sequences. (B, U, D_dec)
  
      """
      batch, length = labels.size()
  
      assert length <= self.context_size, (
          "Context size is too short for current length: %d versus %d"
          % (
              length,
              self.context_size,
          )
      )
  
      x = self.embed_norm(self.embed(labels))
      x = self.dropout_embed(x)
  
      for block in self.rwkv_blocks:
          x, _ = block(x)
  
      x = self.final_norm(x)
  
      return x
  
file_path: espnet/espnet2/asr_transducer/decoder/rwkv_decoder.py
imports: import math
  from typing import Dict, List, Optional, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr_transducer.beam_search_transducer import Hypothesis
  from espnet2.asr_transducer.decoder.abs_decoder import AbsDecoder
  from espnet2.asr_transducer.decoder.blocks.rwkv import RWKV
  from espnet2.asr_transducer.normalization import get_normalization
label_desc: Use image node_id 2 for calling the RWKVDecoder obj's underlying member method code with example usage: obj.forward(labels) and returns: x