docstr: data -- LongTensor -- the LongTensor is strictly ordered
docstr_tok: ["data","--","LongTensor","--","the","LongTensor","is","strictly","ordered"]
code: def __init__(self, data, bsz, bptt, device="cpu", ext_len=None):
      """
      data -- LongTensor -- the LongTensor is strictly ordered
      """
      self.bsz = bsz
      self.bptt = bptt
      self.ext_len = ext_len if ext_len is not None else 0
  
      self.device = device
  
      # Work out how cleanly we can divide the dataset into bsz parts.
      self.n_step = data.size(0) // bsz
  
      # Trim off any extra elements that wouldn't cleanly fit (remainders).
      data = data.narrow(0, 0, self.n_step * bsz)
  
      # Evenly divide the data across the bsz batches.
      self.data = data.view(bsz, -1).t().contiguous().to(device)
  
      # Number of mini-batches
      self.n_batch = (self.n_step + self.bptt - 1) // self.bptt
  
imports: import os, sys
  import glob
  from collections import Counter, OrderedDict
  import numpy
  import torch
  from utils.vocabulary import Vocab
label_desc: Use image node_id 1 to create a new LMOrderedIterator object from inherited base classes: object with example: obj = LMOrderedIterator(data, bsz, bptt, device, ext_len)