class_docstr: Create an encoder over `module` that can process a full sentence.
class_docstr_tok: ["Create","an","encoder","over","`","module","`","that","can","process","a","full","sentence","."]
code: def forward(self, input):
      bs, sl = input.size()
      self.reset()
      mask = input == self.pad_idx
      outs, masks = [], []
      for i in range(0, sl, self.bptt):
          # Note: this expects that sequence really begins on a round multiple of bptt
          real_bs = (input[:, i] != self.pad_idx).long().sum()
          o = self.module(input[:real_bs, i : min(i + self.bptt, sl)])
          if self.max_len is None or sl - i <= self.max_len:
              outs.append(o)
              masks.append(mask[:, i : min(i + self.bptt, sl)])
      outs = torch.cat([_pad_tensor(o, bs) for o in outs], dim=1)
      mask = torch.cat(masks, dim=1)
      return outs, mask
  
imports: from __future__ import annotations
  from ...data.all import *
  from ..core import *
  from .awdlstm import *
label_desc: Use image node_id 3 for calling the SentenceEncoder obj's underlying member method code with example usage: obj.forward(input) and returns: outs,  mask