apply_recipe: Apply a TransformRecipe to a Tensor

View source: R/compiler-apply_recipe.R

apply_recipeR Documentation

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)

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?

Value

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


einops documentation built on Sept. 9, 2025, 5:29 p.m.