Operation

interface Operation(source)

Interface for operations that can be represented as graph nodes. Each operation defines how to execute a computation and its metadata.

Inheritors

Properties

Link copied to clipboard
abstract val name: String

Unique name of this operation type

Link copied to clipboard
abstract val parameters: Map<String, Any>

Parameters for this operation

Link copied to clipboard
abstract val type: String

Type/category of this operation (e.g., "math", "nn", "shape")

Functions

Link copied to clipboard
abstract fun clone(newParameters: Map<String, Any> = parameters): Operation

Clone this operation with potentially different parameters

Link copied to clipboard
abstract fun <T : DType, V> execute(inputs: List<Tensor<T, V>>): List<Tensor<T, V>>

Execute this operation with the given inputs

Link copied to clipboard

Get a human-readable description of this operation

Link copied to clipboard
abstract fun inferOutputs(inputs: List<TensorSpec>): List<TensorSpec>

Infer the output tensor specifications from input specifications

Link copied to clipboard
abstract fun serialize(): Map<String, Any>

Serialize this operation to a map

Link copied to clipboard

Validate that the given inputs are compatible with this operation