DualModule

abstract class DualModule<InT : DType, OutT : DType, V> : ModuleNode(source)

Dual-typed module for dtype-transforming or index-consuming ops. InT is the input dtype, OutT is the output dtype. V is the value buffer backend type.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val children: List<ModuleNode>

Child nodes in the hierarchy.

Link copied to clipboard
open override val id: String

A stable identifier for the node. Not required to be globally unique.

Link copied to clipboard
abstract val modules: List<ModuleNode>

Child modules/nodes for traversal. Keep dtype-agnostic.

Link copied to clipboard
abstract override val name: String

Human-readable module name

Link copied to clipboard
open override val params: List<ModuleParameter<*, *>>

Parameters owned by this node (weights, biases, etc.).

Link copied to clipboard
open override var path: String?

Optional path annotation for nicer logs, e.g., "model.encoder.layer1".

Functions

Link copied to clipboard
abstract fun forward(input: Tensor<InT, V>, ctx: ExecutionContext): Tensor<OutT, V>

Forward pass that requires an ExecutionContext.