class_docstr: Transformer-based Speech-to-Text Decoder from OpenAI's Whisper Model:
  
  URL: https://github.com/openai/whisper
class_docstr_tok: ["Transformer-based","Speech-to-Text","Decoder","from","OpenAI","'s","Whisper","Model",":","URL",":","https",":","\/\/github.com\/openai\/whisper"]
docstr: Forward one step.
  
  Args:
      tgt: input token ids, int64 (batch, maxlen_out)
      tgt_mask: input token mask,  (batch, maxlen_out)
                dtype=torch.uint8 in PyTorch 1.2-
                dtype=torch.bool in PyTorch 1.2+ (include 1.2)
      memory: encoded memory, float32  (batch, maxlen_in, feat)
      cache: cached output list of (batch, max_time_out-1, size)
  Returns:
      y, cache: NN output value and cache per `self.decoders`.
      y.shape` is (batch, maxlen_out, token)
  NOTE (Shih-Lun):
      cache implementation is ignored for now
      for simplicity & correctness
docstr_tok: ["Forward","one","step",".","Args",":","tgt",":","input","token","ids",",","int64","(","batch",",","maxlen_out",")","tgt_mask",":","input","token","mask",",","(","batch",",","maxlen_out",")","dtype=torch.uint8","in","PyTorch","1.2-","dtype=torch.bool","in","PyTorch","1.2+","(","include","1.2",")","memory",":","encoded","memory",",","float32","(","batch",",","maxlen_in",",","feat",")","cache",":","cached","output","list","of","(","batch",",","max_time_out-1",",","size",")","Returns",":","y",",","cache",":","NN","output","value","and","cache","per","`","self.decoders","`",".","y.shape","`","is","(","batch",",","maxlen_out",",","token",")","NOTE","(","Shih-Lun",")",":","cache","implementation","is","ignored","for","now","for","simplicity","&","correctness"]
code: def forward_one_step(
      self,
      tgt: torch.Tensor,
      tgt_mask: torch.Tensor,
      memory: torch.Tensor,
      cache: List[torch.Tensor] = None,
  ) -> Tuple[torch.Tensor, List[torch.Tensor]]:
      """Forward one step.
  
      Args:
          tgt: input token ids, int64 (batch, maxlen_out)
          tgt_mask: input token mask,  (batch, maxlen_out)
                    dtype=torch.uint8 in PyTorch 1.2-
                    dtype=torch.bool in PyTorch 1.2+ (include 1.2)
          memory: encoded memory, float32  (batch, maxlen_in, feat)
          cache: cached output list of (batch, max_time_out-1, size)
      Returns:
          y, cache: NN output value and cache per `self.decoders`.
          y.shape` is (batch, maxlen_out, token)
      NOTE (Shih-Lun):
          cache implementation is ignored for now
          for simplicity & correctness
      """
      x = (
          self.decoders.token_embedding(tgt)
          + self.decoders.positional_embedding[: tgt.size(1)]
      )
      x = self.dropout(x)
      x = x.to(memory.dtype)
  
      for layer, block in enumerate(self.decoders.blocks):
          x = block(x, memory, mask=self.decoders.mask)
          if layer < len(self.decoders.blocks) - 1:
              x = self.dropout(x)
  
      x = self.decoders.ln(x)
      y = x[:, -1]
      y = (
          y
          @ torch.transpose(
              self.decoders.token_embedding.weight.to(x.dtype), 0, 1
          )
      ).float()
      y = torch.log_softmax(y, dim=-1)
  
      return y, None
  
file_path: espnet/espnet2/asr/decoder/whisper_decoder.py
imports: import copy
  from typing import Any, List, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 3 for calling the OpenAIWhisperDecoder obj's underlying member method code with example usage: obj.forward_one_step(tgt, tgt_mask, memory, cache) and returns: y,  None