class_docstr: E2E module.
  
  :param int idim: dimension of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
class_docstr_tok: ["E2E","module",".",":","param","int","idim",":","dimension","of","inputs",":","param","int","odim",":","dimension","of","outputs",":","param","Namespace","args",":","argument","Namespace","containing","options"]
docstr: Encode acoustic features.
  
  :param ndarray x: input acoustic feature (T, D)
  :return: encoder outputs
  :rtype: torch.Tensor
code: def encode(self, x):
      """Encode acoustic features.
  
      :param ndarray x: input acoustic feature (T, D)
      :return: encoder outputs
      :rtype: torch.Tensor
      """
      self.eval()
      ilens = [x.shape[0]]
  
      # subsample frame
      x = x[:: self.subsample[0], :]
      p = next(self.parameters())
      h = torch.as_tensor(x, device=p.device, dtype=p.dtype)
      # make a utt list (1) to use the same interface for encoder
      hs = h.contiguous().unsqueeze(0)
  
      # 0. Frontend
      if self.frontend is not None:
          enhanced, hlens, mask = self.frontend(hs, ilens)
          hs, hlens = self.feature_transform(enhanced, hlens)
      else:
          hs, hlens = hs, ilens
  
      # 1. encoder
      hs, _, _ = self.enc(hs, hlens)
      return hs.squeeze(0)
  
imports: import argparse
  import logging
  import math
  import os
  from itertools import groupby
  import chainer
  import numpy
  import torch
  from chainer import reporter
  from espnet.nets.asr_interface import ASRInterface
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.pytorch_backend.ctc import ctc_for
  from espnet.nets.pytorch_backend.frontends.feature_transform import feature_transform_for
  from espnet.nets.pytorch_backend.frontends.frontend import frontend_for
  from espnet.nets.pytorch_backend.initialization import lecun_normal_init_parameters, set_forget_bias_to_one
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, pad_list, to_device, to_torch_tensor
  from espnet.nets.pytorch_backend.rnn.argument import add_arguments_rnn_attention_common, add_arguments_rnn_decoder_common, add_arguments_rnn_encoder_common
  from espnet.nets.pytorch_backend.rnn.attentions import att_for
  from espnet.nets.pytorch_backend.rnn.decoders import decoder_for
  from espnet.nets.pytorch_backend.rnn.encoders import encoder_for
  from espnet.nets.scorers.ctc import CTCPrefixScorer
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 10 for calling the E2E obj's underlying member method code with example usage: obj.encode(x) and returns: hs