class_docstr: Abstract sequence model class.
  
  All models must adhere to this interface
  
  A SequenceModule is generally a model that transforms an input of shape
  (n_batch, l_sequence, d_model) to (n_batch, l_sequence, d_output)
  
  REQUIRED methods and attributes
  forward, d_model, d_output: controls standard forward pass,
  a sequence-to-sequence transformation
  __init__ should also satisfy the following interface;
  see SequenceIdentity for an example
      def __init__(self, d_model, transposed=False, **kwargs)
  
  OPTIONAL methods
  default_state, step: allows stepping the model recurrently with a hidden state
  state_to_tensor, d_state: allows decoding from hidden state
class_docstr_tok: ["Abstract","sequence","model","class",".","All","models","must","adhere","to","this","interface","A","SequenceModule","is","generally","a","model","that","transforms","an","input","of","shape","(","n_batch",",","l_sequence",",","d_model",")","to","(","n_batch",",","l_sequence",",","d_output",")","REQUIRED","methods","and","attributes","forward",",","d_model",",","d_output",":","controls","standard","forward","pass",",","a","sequence-to-sequence","transformation","__init__","should","also","satisfy","the","following","interface",";","see","SequenceIdentity","for","an","example","def","__init__","(","self",",","d_model",",","transposed=False",",","*","*","kwargs",")","OPTIONAL","methods","default_state",",","step",":","allows","stepping","the","model","recurrently","with","a","hidden","state","state_to_tensor",",","d_state",":","allows","decoding","from","hidden","state"]
docstr: Step the model recurrently for one step of the input sequence.
  
  For example, this should correspond to unrolling an RNN for one step.
  If the forward pass has signature (B, L, H1) -> (B, L, H2),
  this method should generally have signature
  (B, H1) -> (B, H2) with an optional recurrent state.
docstr_tok: ["Step","the","model","recurrently","for","one","step","of","the","input","sequence",".","For","example",",","this","should","correspond","to","unrolling","an","RNN","for","one","step",".","If","the","forward","pass","has","signature","(","B",",","L",",","H1",")","-",">","(","B",",","L",",","H2",")",",","this","method","should","generally","have","signature","(","B",",","H1",")","-",">","(","B",",","H2",")","with","an","optional","recurrent","state","."]
code: def step(self, x, state=None, **kwargs):
      """Step the model recurrently for one step of the input sequence.
  
      For example, this should correspond to unrolling an RNN for one step.
      If the forward pass has signature (B, L, H1) -> (B, L, H2),
      this method should generally have signature
      (B, H1) -> (B, H2) with an optional recurrent state.
      """
      raise NotImplementedError
  
file_path: espnet/espnet2/asr/state_spaces/base.py
imports: import functools
  from torch import nn
label_desc: Use image node_id 9 for calling the SequenceModule obj's underlying member method code with example usage: obj.step(x, state) without return types