Skip to main content

Parameter

A tensor a module registers as a learned weight. Assigning one to a module attribute files it under that name, and it takes part in every tensor operation unchanged (isinstance(p, Tensor) holds). Parameter(data) wraps data without copying: both share one storage. A layer's .weight is a Parameter view of its slot: after the layer packs, a view held across the forward answers its metadata (dtype, shape, device, numel) without a copy, and a value read through the layer (layer.weight) reconstructs the weight once.

data (property)​

The plain tensor handle behind this parameter (shared storage). Assigning rebinds the parameter to another tensor's storage in place, so the object a module attribute holds is unchanged by a move or a cast.

__init__​

__init____init__(self, data: clika_runtime._core.Tensor) -> None

init(self, data: clika_runtime._core.Tensor) -> None

Wrap data without copying; the parameter shares its storage.