class_docstr: Simple utiliy mix-in to export models that consist of encoder/decoder pair
  plus pre/post processor, but have to be exported as encoder/decoder pair only
  (covers most ASR classes)
class_docstr_tok: ["Simple","utiliy","mix-in","to","export","models","that","consist","of","encoder\/decoder","pair","plus","pre\/post","processor",",","but","have","to","be","exported","as","encoder\/decoder","pair","only","(","covers","most","ASR","classes",")"]
docstr: This forward is used when we need to export the model to ONNX format.
  Inputs cache_last_channel and cache_last_time are needed to be passed for exporting streaming models.
  Args:
      input: Tensor that represents a batch of raw audio signals,
          of shape [B, T]. T here represents timesteps.
      length: Vector of length B, that contains the individual lengths of the audio sequences.
      cache_last_channel: Tensor of shape [N, B, T, H] which contains the cache for last channel layers
      cache_last_time: Tensor of shape [N, B, H, T] which contains the cache for last time layers
          N is the number of such layers which need caching, B is batch size, H is the hidden size of activations,
          and T is the length of the cache
  
  Returns:
      the output of the model
docstr_tok: ["This","forward","is","used","when","we","need","to","export","the","model","to","ONNX","format",".","Inputs","cache_last_channel","and","cache_last_time","are","needed","to","be","passed","for","exporting","streaming","models",".","Args",":","input",":","Tensor","that","represents","a","batch","of","raw","audio","signals",",","of","shape","[","B",",","T","]",".","T","here","represents","timesteps",".","length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","audio","sequences",".","cache_last_channel",":","Tensor","of","shape","[","N",",","B",",","T",",","H","]","which","contains","the","cache","for","last","channel","layers","cache_last_time",":","Tensor","of","shape","[","N",",","B",",","H",",","T","]","which","contains","the","cache","for","last","time","layers","N","is","the","number","of","such","layers","which","need","caching",",","B","is","batch","size",",","H","is","the","hidden","size","of","activations",",","and","T","is","the","length","of","the","cache","Returns",":","the","output","of","the","model"]
code: def forward_for_export(
      self,
      input,
      length=None,
      cache_last_channel=None,
      cache_last_time=None,
      cache_last_channel_len=None,
  ):
      """
      This forward is used when we need to export the model to ONNX format.
      Inputs cache_last_channel and cache_last_time are needed to be passed for exporting streaming models.
      Args:
          input: Tensor that represents a batch of raw audio signals,
              of shape [B, T]. T here represents timesteps.
          length: Vector of length B, that contains the individual lengths of the audio sequences.
          cache_last_channel: Tensor of shape [N, B, T, H] which contains the cache for last channel layers
          cache_last_time: Tensor of shape [N, B, H, T] which contains the cache for last time layers
              N is the number of such layers which need caching, B is batch size, H is the hidden size of activations,
              and T is the length of the cache
  
      Returns:
          the output of the model
      """
      enc_fun = getattr(
          self.input_module,
          "forward_for_export",
          self.input_module.forward,
      )
      if cache_last_channel is None:
          encoder_output = enc_fun(audio_signal=input, length=length)
          if isinstance(encoder_output, tuple):
              encoder_output = encoder_output[0]
      else:
          (
              encoder_output,
              length,
              cache_last_channel,
              cache_last_time,
              cache_last_channel_len,
          ) = enc_fun(
              audio_signal=input,
              length=length,
              cache_last_channel=cache_last_channel,
              cache_last_time=cache_last_time,
              cache_last_channel_len=cache_last_channel_len,
          )
  
      dec_fun = getattr(
          self.output_module,
          "forward_for_export",
          self.output_module.forward,
      )
      ret = dec_fun(encoder_output=encoder_output)
      if isinstance(ret, tuple):
          ret = ret[0]
      if cache_last_channel is not None:
          ret = (
              ret,
              length,
              cache_last_channel,
              cache_last_time,
              cache_last_channel_len,
          )
      return cast_all(
          ret, from_dtype=torch.float16, to_dtype=torch.float32
      )
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import List
  import torch
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.core.classes.exportable import Exportable
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.utils.neural_type_utils import get_io_names
  from nemo.utils import logging, model_utils
  from nemo.utils.cast_utils import cast_all
label_desc: Use image node_id 4 for calling the ExportableEncDecModel obj's underlying member method code with example usage: obj.forward_for_export(input, length, cache_last_channel, cache_last_time, cache_last_channel_len) and returns: cast_all