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: Return a function mapping a state to a single tensor.
  
  This method should be implemented if one wants to use
  the hidden state insteadof the output sequence for final prediction.
  Currently only used with the StateDecoder.
docstr_tok: ["Return","a","function","mapping","a","state","to","a","single","tensor",".","This","method","should","be","implemented","if","one","wants","to","use","the","hidden","state","insteadof","the","output","sequence","for","final","prediction",".","Currently","only","used","with","the","StateDecoder","."]
code: def state_to_tensor(self):
      """Return a function mapping a state to a single tensor.
  
      This method should be implemented if one wants to use
      the hidden state insteadof the output sequence for final prediction.
      Currently only used with the StateDecoder.
      """
      return lambda _: None
  
file_path: espnet/espnet2/asr/state_spaces/base.py
imports: import functools
  from torch import nn
label_desc: Use image node_id 6 for calling the SequenceModule obj's underlying member method code with example usage: obj.state_to_tensor() and returns: function