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<Module<T, V>>
Link copied to clipboard
abstract override val name: String

Human-readable name of the node, typically the module's 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
fun <T : DType, V> Module<T, V>.describe(input: Shape, ctx: ExecutionContext, dtypeClass: KClass<T>, batch_size: Int = -1): String
Link copied to clipboard
open fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>
Link copied to clipboard
operator fun <T : DType, V> Module<T, V>.invoke(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>

Convenience operator to call a Module with an explicit ExecutionContext. This does not re-introduce the legacy context-less invoke; callers must pass ctx.

Link copied to clipboard

Collect all trainable parameters for this module and its subtree. Trainable is defined by ModuleParameter.requiresGrad flag.

Link copied to clipboard
fun zeroGrad()

Zero-out accumulated gradients for all trainable parameters in this module subtree.