This function does the following parts of the einops 'compilation' pipeline:
Lexing: tokenizing the input expression string
Parsing: converting the tokens into an Abstract Syntax Tree (AST)
Syntactic Analysis:
operation-based AST validation pass
Compile syntactic info for intermediate representation (IR).
IR generation: return the TransformRecipe()
object.
prepare_transformation_recipe(
expr,
func,
axes_names,
ndim,
reverse_groups = FALSE
)
a populated TransformRecipe()
object
The input einops expression string
The string/function indicating the reduction operation
user defined axis names as a character()
vector.
count for the number of dimensions of the input tensor
logical: whether
to reverse the order of the axes in each group.