29389772364178f76ccf565917870639cad283bb,einops.py,,get_axes_names,#Any#,124
Before Change
def get_axes_names(composite_axis_name: str):
// TODO add spaces and long names
elementary_axes = []
composite_axis_name = list(composite_axis_name)
while len(composite_axis_name) > 0:
letter = composite_axis_name.pop()
if "a" <= letter <= "z" or letter == "_":
elementary_axes.append(letter)
else:
assert "0" <= letter <= "9"
prev_letter = composite_axis_name.pop()
assert "a" <= prev_letter <= "z"
elementary_axes.append(prev_letter + letter)
return elementary_axes[::-1]
def transpose(tensor, pattern, **axes_lengths):
After Change
def get_axes_names(composite_axis_name: str):
axes_names = [axis for axis in composite_axis_name.split(" ") if len(axis) > 0]
for axis in axes_names:
if axis == "_":
continue
assert "a" <= axis[0] <= "z"
for letter in axis:
assert str.isdigit(letter) or "a" <= letter <= "z"
return axes_names
def transpose(tensor, pattern, **axes_lengths):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: arogozhnikov/einops
Commit Name: 29389772364178f76ccf565917870639cad283bb
Time: 2018-09-27
Author: iamfullofspam@gmail.com
File Name: einops.py
Class Name:
Method Name: get_axes_names
Project Name: home-assistant/home-assistant
Commit Name: 5fba67f6c37a7c36935e4f9cb227b21f1b7a1c7b
Time: 2015-11-29
Author: happyleaves.tfr@gmail.com
File Name: homeassistant/components/light/limitlessled.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: d91fe792c56d872e9054fd608978fd51a99142dd
Time: 2015-11-27
Author: happyleaves.tfr@gmail.com
File Name: homeassistant/components/light/limitlessled.py
Class Name:
Method Name: setup_platform