b939c910d036d8197ac7c63e5f188bc4c4fc4803,foolbox/batching.py,,run_parallel,#Any#Any#Any#Any#Any#Any#Any#Any#,94

Before Change



        if len(attacks_requesting_batched_predictions) > 0:
            logging.debug("calling native forward with {}".format(len(attacks_requesting_batched_predictions)))  // noqa: E501
            batched_predictions_args = list(map(np.stack,
                                                zip(*batched_predictions_args)))
            batched_predictions_args = list(batched_predictions_args)
            // get original shape (//attacks, batch size)
            batch_shape = batched_predictions_args[0].shape

After Change


            logging.debug("calling native forward with {}".format(len(attacks_requesting_batched_predictions)))  // noqa: E501

            // we are only interested in the first argument
            inputs = [x[0] for x in batched_predictions_args]

            // merge individual batches into one larger super-batch
            batch_lengths = [len(x) for x in inputs]
            batch_splits = np.cumsum(batch_lengths)
            inputs = np.concatenate([x for x in inputs])

            // split super-batch back into individual batches
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: bethgelab/foolbox
Commit Name: b939c910d036d8197ac7c63e5f188bc4c4fc4803
Time: 2019-07-20
Author: rzrolandzimmermann@gmail.com
File Name: foolbox/batching.py
Class Name:
Method Name: run_parallel


Project Name: ANSSI-FR/SecuML
Commit Name: 14b0d3efb14e998029aa3f2e633afda4b8436118
Time: 2019-05-03
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/core/classif/monitoring/prediction/proba_barplot.py
Class Name: ProbaBarplot
Method Name: display_label


Project Name: nipy/dipy
Commit Name: 76d958d356ee55999b02fb4447c02008c5ca050e
Time: 2014-10-08
Author: marc.cote.19@gmail.com
File Name: dipy/tracking/tests/test_streamline.py
Class Name:
Method Name: test_set_number_of_points


Project Name: librosa/librosa
Commit Name: d17a2986a9a3ff59b8c285fc884b808557724bd6
Time: 2014-11-06
Author: brian.mcfee@nyu.edu
File Name: librosa/filters.py
Class Name:
Method Name: constant_q