ggml_pop_layer: Remove the Last Layer from a Sequential Model

View source: R/nn_model.R

ggml_pop_layerR Documentation

Remove the Last Layer from a Sequential Model

Description

Removes the last layer from the model. The model must not be compiled.

Usage

ggml_pop_layer(model)

Arguments

model

A ggml_sequential_model object

Value

The model with the last layer removed.

Examples


model <- ggml_model_sequential() |>
  ggml_layer_dense(64, activation = "relu") |>
  ggml_layer_dense(10, activation = "softmax")

model <- ggml_pop_layer(model)
length(model$layers)  # 1


ggmlR documentation built on July 14, 2026, 1:08 a.m.