class_docstr: A Multigrid Method for Efficiently Training Video Models
  Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, Philipp Krähenbühl
  CVPR 2020, https://arxiv.org/abs/1912.00998
class_docstr_tok: ["A","Multigrid","Method","for","Efficiently","Training","Video","Models","Chao-Yuan","Wu",",","Ross","Girshick",",","Kaiming","He",",","Christoph","Feichtenhofer",",","Philipp","Kr\u00e4henb\u00fchl","CVPR","2020",",","https",":","\/\/arxiv.org\/abs\/1912.00998"]
code: def __len__(self):
      scale_per_short_cycle = 0
      for x in range(self.mg_helper.mod_short):
          scale_per_short_cycle += self.mg_helper.get_scale(
              self.alpha, x
          )
      num_full_short_cycle = len(self.sampler) // (
          self.batch_size * scale_per_short_cycle
      )
  
      total = num_full_short_cycle * self.mg_helper.mod_short
      remain = len(self.sampler) % (
          self.batch_size * scale_per_short_cycle
      )
      for x in range(self.mg_helper.mod_short):
          remain = (
              remain
              - self.mg_helper.get_scale(self.alpha, x)
              * self.batch_size
          )
          if remain >= 0 or (remain < 0 and self.drop_last is False):
              total += 1
          if remain <= 0:
              break
      assert remain <= 0
      return total
  
file_path: gluon-cv/gluoncv/torch/data/video_cls/multigrid_helper.py
imports: from functools import reduce
  import numpy
  from torch.utils.data import Sampler
label_desc: Use image node_id 7 for calling the MultiGridBatchSampler obj's underlying member method code with example usage: obj.__len__() and returns: total