Learn R Programming

einops (version 0.2.1)

apply_recipe: Apply a TransformRecipe to a Tensor

Description

This function applies a TransformRecipe to a tensor, performing rearrangement and reduction as specified by the recipe.

TODO docs for which parts of the compilation pipeline this is.

Usage

apply_recipe(backend, recipe, tensor, reduction_type, axes_lengths)

Value

A tensor that has been transformed according to the recipe, with the same type (if possible) as the input tensor.

Arguments

backend

The EinopsBackend() to use for tensor operations.

recipe

A TransformRecipe() that specifies how to transform the tensor.

tensor

A tensor to be transformed

reduction_type

A character of length 1 that specifies the type of reduction to apply.

axes_lengths

TODO check - I think its just an integer vector?