register_backend: Register a new backend for a tensor type

View source: R/compiler-backends.R

register_backendR Documentation

Register a new backend for a tensor type

Description

Registers a backend implementation for a specific tensor type, along with any required dependencies, testing flag, and optional aliases. This function wraps the backend class in a thunk() and registers it with the backend registry.

Usage

register_backend(
  tensor_type,
  backend_class,
  dependencies = character(0),
  testing = FALSE,
  aliases = character(0)
)

Arguments

tensor_type

A string specifying the tensor type the backend supports.

backend_class

An R6Class generator for the backend (subclass of EinopsBackend). Note that this binding does not necessarily have to have a defined value at the time of calling this function.

dependencies

Optional character vector of required package names.

testing

If TRUE, indicates its only used for testing.

aliases

Optional character vector of aliases for the tensor type.

Value

Invisibly returns the backend registry object.


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