class_docstr: Common API for streaming components.
  
  Each streaming component has a streaming state, which is just a dict[str, Tensor].
  By convention, the first dim of each tensor must be the batch size.
  Don't use dots in the key names, as this would clash with submodules
  (like in state_dict).
  
  If `self._is_streaming` is True, the component should use and remember
  the proper state inside `self._streaming_state`.
  
  To set a streaming component in streaming state, use
  
      with module.streaming():
          ...
  
  This will automatically reset the streaming state when exiting the context manager.
  This also automatically propagates to all streaming children module.
  
  Some module might also implement the `StreamingModule.flush` method, although
  this one is trickier, as all parents module must be StreamingModule and implement
  it as well for it to work properly. See `StreamingSequential` after.
class_docstr_tok: ["Common","API","for","streaming","components",".","Each","streaming","component","has","a","streaming","state",",","which","is","just","a","dict","[","str",",","Tensor","]",".","By","convention",",","the","first","dim","of","each","tensor","must","be","the","batch","size",".","Do","n't","use","dots","in","the","key","names",",","as","this","would","clash","with","submodules","(","like","in","state_dict",")",".","If","`","self._is_streaming","`","is","True",",","the","component","should","use","and","remember","the","proper","state","inside","`","self._streaming_state","`",".","To","set","a","streaming","component","in","streaming","state",",","use","with","module.streaming","(",")",":","...","This","will","automatically","reset","the","streaming","state","when","exiting","the","context","manager",".","This","also","automatically","propagates","to","all","streaming","children","module",".","Some","module","might","also","implement","the","`","StreamingModule.flush","`","method",",","although","this","one","is","trickier",",","as","all","parents","module","must","be","StreamingModule","and","implement","it","as","well","for","it","to","work","properly",".","See","`","StreamingSequential","`","after","."]
docstr: Flush any remaining outputs that were waiting for completion.
  Typically, for convolutions, this will add the final padding
  and process the last buffer.
  
  This should take an optional argument `x`, which will be provided
  if a module before this one in the streaming pipeline has already
  spitted out a flushed out buffer.
docstr_tok: ["Flush","any","remaining","outputs","that","were","waiting","for","completion",".","Typically",",","for","convolutions",",","this","will","add","the","final","padding","and","process","the","last","buffer",".","This","should","take","an","optional","argument","`","x","`",",","which","will","be","provided","if","a","module","before","this","one","in","the","streaming","pipeline","has","already","spitted","out","a","flushed","out","buffer","."]
code: def flush(self, x: tp.Optional[torch.Tensor] = None):
      """Flush any remaining outputs that were waiting for completion.
      Typically, for convolutions, this will add the final padding
      and process the last buffer.
  
      This should take an optional argument `x`, which will be provided
      if a module before this one in the streaming pipeline has already
      spitted out a flushed out buffer.
      """
      if x is None:
          return None
      else:
          return self(x)
  
file_path: audiocraft/audiocraft/modules/streaming.py
imports: from contextlib import contextmanager
  import typing
  from torch import nn
  import torch
label_desc: Use image node_id 8 for calling the StreamingModule obj's underlying member method code with example usage: obj.flush(x) and returns: None, self