On this page

TensorFunctionLibrary

symbolica.community.spenso Class

TensorFunctionLibrary()

A registry of elementwise tensor functions used during network evaluation.

Constructor

#

Create a new empty tensor function library.

Initializes an empty library ready for registering tensor functions.

Returns

TensorFunctionLibrary

A new empty function library

Examples

from symbolica.community.spenso import TensorFunctionLibrary
lib = TensorFunctionLibrary()

Member details

register

Method
#
register(function: BroadcastFunction, callback: Any) -> None

Register an elementwise callback for concrete tensor execution.

The callback receives a Python float or complex matching each input value and must return either type. The result uses complex storage if any returned value is complex; otherwise it uses real storage.

Parameters

NameTypeDefaultDescription
functionBroadcastFunction——
callbackAny——