nn_norm_broadcast: Reshape 1-D gamma/beta so they broadcast along the feature...

View source: R/nn_layers.R

nn_norm_broadcastR Documentation

Reshape 1-D gamma/beta so they broadcast along the feature axis

Description

The feature axis moves with the input rank: an image is ggml [W, H, C, N] (channels at ne[2]), a sequence is [size, seq, N] (features at ne[0]), and a flat input needs no reshape at all.

Usage

nn_norm_broadcast(ctx, w, input_shape)

Arguments

ctx

A ggml_context.

w

A 1-D ggml_tensor of per-feature weights.

input_shape

The layer's input shape, in R order.

Value

w, reshaped to broadcast.


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