TorchLean API

NN.Spec.Module.Linear

Linear modules #

The mathematical forward map comes from Spec.linearSpec. This file packages it as a shape-indexed Spec.Module for composition and source export.

def Spec.Module.linear {α : Type} [TorchLean.Storage α] [Add α] [Mul α] [Zero α] {inDim outDim : } (m : LinearSpec α inDim outDim) :
Module α [inDim] [outDim]

A linear layer as a mathematical module.

Instances For