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)
      speech: encoded speech, float32  (batch, maxlen_in, feat)
      cache: cached output list of (batch, max_time_out-1, size)
      return_hs: dec hidden state corresponding to ys,
          used for searchable hidden ints
  Returns:
      y, cache: NN output value and cache per `self.decoders`.
      y.shape` is (batch, maxlen_out, token)
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",")","speech",":","encoded","speech",",","float32","(","batch",",","maxlen_in",",","feat",")","cache",":","cached","output","list","of","(","batch",",","max_time_out-1",",","size",")","return_hs",":","dec","hidden","state","corresponding","to","ys",",","used","for","searchable","hidden","ints","Returns",":","y",",","cache",":","NN","output","value","and","cache","per","`","self.decoders","`",".","y.shape","`","is","(","batch",",","maxlen_out",",","token",")"]
code: def forward_one_step(
      self,
      tgt: torch.Tensor,
      tgt_mask: torch.Tensor,
      memory: torch.Tensor,
      speech: torch.Tensor = None,
      cache: List[torch.Tensor] = None,
      return_hs: bool = False,
  ) -> 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)
          speech: encoded speech, float32  (batch, maxlen_in, feat)
          cache: cached output list of (batch, max_time_out-1, size)
          return_hs: dec hidden state corresponding to ys,
              used for searchable hidden ints
      Returns:
          y, cache: NN output value and cache per `self.decoders`.
          y.shape` is (batch, maxlen_out, token)
      """
      x = self.embed(tgt)
      if cache is None:
          cache = [None] * len(self.decoders)
      new_cache = []
      for c, decoder in zip(cache, self.decoders):
          if self.use_speech_attn:
              (
                  x,
                  tgt_mask,
                  memory,
                  memory_mask,
                  _,
                  speech,
                  speech_mask,
              ) = decoder(x, tgt_mask, memory, None, c, speech, None)
          else:
              x, tgt_mask, memory, memory_mask = decoder(
                  x, tgt_mask, memory, None, cache=c
              )
          new_cache.append(x)
  
      if self.normalize_before:
          y = self.after_norm(x[:, -1])
      else:
          y = x[:, -1]
  
      if return_hs:
          h_asr = y
  
      if self.output_layer is not None:
          y = torch.log_softmax(self.output_layer(y), dim=-1)
  
      if return_hs:
          return y, h_asr, new_cache
      return y, new_cache
  
imports: from typing import Any, List, Sequence, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.decoder_layer import DecoderLayer
  from espnet.nets.pytorch_backend.transformer.dynamic_conv import DynamicConvolution
  from espnet.nets.pytorch_backend.transformer.dynamic_conv2d import DynamicConvolution2D
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
  from espnet.nets.pytorch_backend.transformer.lightconv import LightweightConvolution
  from espnet.nets.pytorch_backend.transformer.lightconv2d import LightweightConvolution2D
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
  from espnet.nets.pytorch_backend.transformer.positionwise_feed_forward import PositionwiseFeedForward
  from espnet.nets.pytorch_backend.transformer.repeat import repeat
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 3 for calling the TransformerMDDecoder obj's underlying member method code with example usage: obj.forward_one_step(tgt, tgt_mask, memory, speech, cache, return_hs) and returns: y,  new_cache, y,  h_asr,  new_cache