nn_functional_weight_elements: Count the weight elements a functional node will allocate

View source: R/nn_functional.R

nn_functional_weight_elementsR Documentation

Count the weight elements a functional node will allocate

Description

Mirrors the tensor shapes nn_build_functional_node creates in ctx_weights, so the context can be sized before the tensors exist. Weights do not scale with the batch, which is what makes this a separate count from the activations rather than a factor applied to them.

Usage

nn_functional_weight_elements(node, parent_shapes)

Details

Returns a double: a wide dense layer can exceed integer range on its own.

Value

A double, the number of float elements the node's weights occupy.


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.