b7efa1f037f8adc94a28fc421dd7934b63b3043e,geomstats/_backend/numpy/__init__.py,,assignment,#Any#Any#Any#Any#,121
Before Change
indices = [indices]
if not isinstance(values, list):
values = [values] * len(indices)
for nb_index, index in enumerate(indices):
if not isinstance(index, tuple):
index = (index,)
if len(index) < len(shape(x)):
for n_axis in range(shape(x)[axis]):
extended_index = index[:axis] + (n_axis,) + index[axis:]
x_new[extended_index] = values[nb_index]
else:
x_new[index] = values[nb_index]
return x_new
def assignment_by_sum(x, values, indices, axis=0):
After Change
if not use_vectorization:
x_new[indices] = values
else:
indices = tuple(
list(indices[:axis]) + [slice(None)] + list(indices[axis:]))
x_new[indices] = values
return x_new
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: geomstats/geomstats
Commit Name: b7efa1f037f8adc94a28fc421dd7934b63b3043e
Time: 2020-04-22
Author: 62605255+pchauchat@users.noreply.github.com
File Name: geomstats/_backend/numpy/__init__.py
Class Name:
Method Name: assignment
Project Name: geomstats/geomstats
Commit Name: 6a534c44a8af152d38d833c370695e54ff1dfa20
Time: 2020-05-06
Author: ninamio78@gmail.com
File Name: geomstats/_backend/numpy/__init__.py
Class Name:
Method Name: convert_to_wider_dtype
Project Name: jsalt18-sentence-repl/jiant
Commit Name: 2573c649518391ada6214cfc72d20421dfac4072
Time: 2018-03-16
Author: wang.alex.c@gmail.com
File Name: src/preprocess.py
Class Name:
Method Name: get_embeddings
Project Name: geomstats/geomstats
Commit Name: bcb31499b3bab0b31e7f45c38e77571fa6ccb0c1
Time: 2020-05-06
Author: ninamio78@gmail.com
File Name: geomstats/_backend/tensorflow/__init__.py
Class Name:
Method Name: convert_to_wider_dtype