Formatting. Args: name: The name/alias This function takes in a name and converts it to a standard format of group1_group2. Where as per the regular expression, group1 can have alphabets and numbers and group2 has capital alphabets.
(name)
| 36 | |
| 37 | |
| 38 | def _convert_(name): |
| 39 | """ |
| 40 | Formatting. |
| 41 | |
| 42 | Args: |
| 43 | name: The name/alias |
| 44 | |
| 45 | This function takes in a name and converts it to a standard format of |
| 46 | group1_group2. Where as per the regular expression, group1 can have |
| 47 | alphabets and numbers and group2 has capital alphabets. |
| 48 | |
| 49 | """ |
| 50 | s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) |
| 51 | return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() |
| 52 | |
| 53 | |
| 54 | def generate_layer_fn(op_type: str): |