Learn R Programming

einops (version 0.2.1)

as_iterables: Convert an object to a list of iterables (lists)

Description

This function converts an object into a list of iterables, where each iterable is a list of elements. The function is generic and can be extended for different classes.

Usage

as_iterables(x, ...)

Value

a list of iterables, where each iterable is a list of elements

Arguments

x

the input object to be converted

...

additional arguments (not used)

AxisNames

This method converts an AxisNames object into a list of iterables. Each element in the AxisNames is processed to extract its name or constant value. If the element is a ConstantAstNode with a count of 1, it is converted to an empty list. Otherwise, it is wrapped in a list. If the element is a NamedAxisAstNode, its name is extracted. Regular AxisNames that are nested will be unclassed