2546dbadb426502d169aed5beb5933255b6f2208,examples/tsf/utils.py,,get_batches,#Any#Any#Any#Any#Any#,51

Before Change


  s = 0
  while s < n:
    t = min(s + batch_size, n)
    if t < s + batch_size:
      break
    batches.append(get_batch(x0[s:t] + x1[s:t],
                             [0] * (t-s) + [1]*(t-s),
                             word2id,
                             batch_size))

After Change


def get_batches(x0, x1, word2id, batch_size, sort=False):
  // half as batch size
  batch_size = batch_size // 2
  n = max(len(x0), len(x1))
  n = (n // batch_size + 1) * batch_size
  if len(x0) < n:
    x0 = makeup(x0, n)
  if len(x1) < n:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: asyml/texar
Commit Name: 2546dbadb426502d169aed5beb5933255b6f2208
Time: 2017-12-02
Author: zichaoy@cs.cmu.edu
File Name: examples/tsf/utils.py
Class Name:
Method Name: get_batches


Project Name: pyinstaller/pyinstaller
Commit Name: 88c20d965de6342244ba942f8a355ebfb2f8133c
Time: 2016-02-29
Author: garth@garthy.com
File Name: PyInstaller/archive/readers.py
Class Name: CArchiveReader
Method Name: checkmagic


Project Name: automl/auto-sklearn
Commit Name: 58b135d34fd787cf42a1649cd94bb38c54214cbd
Time: 2016-02-12
Author: feurerm@informatik.uni-freiburg.de
File Name: autosklearn/smbo.py
Class Name: AutoMLSMBO
Method Name: run_smbo