5273d873b9154ad706bfdfcf4fc8e2354fd425c0,deepchem/models/__init__.py,Model,predict,#Model#Any#,146

Before Change


      if sys.getsizeof(X) > MAX_GPU_RAM:
        nb_block = float(sys.getsizeof(X))/MAX_GPU_RAM
        nb_sample = np.shape(X)[0]
        interval_points = np.linspace(0,nb_sample,nb_block+1).astype(int)
        y_preds = []
        for j in range(0,len(interval_points)-1):
          indices = range(interval_points[j],interval_points[j+1])
          y_preds.append(self.predict_on_batch(X[indices,:]))

After Change


    for (X, y, w, ids) in dataset.itershards():
      nb_sample = np.shape(X)[0]
      interval_points = np.linspace(
          0, nb_sample, np.ceil(float(nb_sample)/batch_size)+1).astype(int)
      y_preds = []
      for j in range(0,len(interval_points)-1):
        indices = range(interval_points[j],interval_points[j+1])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepchem/deepchem
Commit Name: 5273d873b9154ad706bfdfcf4fc8e2354fd425c0
Time: 2016-01-16
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/__init__.py
Class Name: Model
Method Name: predict


Project Name: keras-team/keras
Commit Name: 42ccc34b337f9eb05de7f864a88844352740133a
Time: 2017-11-18
Author: ozabluda@gmail.com
File Name: examples/mnist_dataset_api.py
Class Name:
Method Name:


Project Name: scikit-image/scikit-image
Commit Name: 82111e4c0b3169a3856da02112c86447a3381ecc
Time: 2019-09-11
Author: r.fezzani@vitadx.com
File Name: skimage/transform/radon_transform.py
Class Name:
Method Name: radon