Learn R Programming

einops (version 0.2.1)

expand_ellipsis: Expand ellipses of an EinopsAst

Description

Helper for prepare_transformation_recipe().

This function expands each relevant ellipsis ast node in-place into a sequence of NamedAxisAstNode nodes, where each node will have a name like "...1", "...2", etc. and an empty src list.

Also does some further validation of the ellipses syntax using ndim.

Usage

expand_ellipsis(einops_ast, ndim)

Value

an expanded EinopsAst with ellipses expanded

Arguments

einops_ast

an EinopsAst

ndim

integer. Number of dimensions in the input tensor