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
// merge individual batches into one super-batch
After Change
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
batched_predictions = model.forward(inputs)
batched_predictions = np.split(batched_predictions, batch_splits,
axis=0)
else:
batched_predictions = []
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
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: geomstats/geomstats
Commit Name: 35364f3d1dc129e68d8f5da1cf1d090073e4b556
Time: 2017-10-25
Author: ninamio78@gmail.com
File Name: unittests.py
Class Name: TestGeomstatsMethods
Method Name: test_rigid_transformations_group_exp_log
Project Name: geomstats/geomstats
Commit Name: 35364f3d1dc129e68d8f5da1cf1d090073e4b556
Time: 2017-10-25
Author: ninamio78@gmail.com
File Name: unittests.py
Class Name: TestGeomstatsMethods
Method Name: test_rigid_transformations_riemannian_exp_log