ag_concat_rows: Concatenate two tensors by rows

View source: R/autograd.R

ag_concat_rowsR Documentation

Concatenate two tensors by rows

Description

Stacks a above b, like rbind(a, b): both must have the same number of columns (the batch). Typical use is a critic input built from observations and an action computed by the actor. The gradient of a is rows 1..nrow(a) of the incoming gradient and that of b the rest; an operand without gradient gets none.

Usage

ag_concat_rows(a, b)

Arguments

a, b

ag_tensors (or matrices) with the same number of columns

Value

ag_tensor of shape (nrow(a) + nrow(b)) x ncol(a)

See Also

ag_slice_rows

Examples

a <- ag_tensor(matrix(1:6, 2, 3)); b <- ag_tensor(matrix(7:9, 1, 3))
as.matrix(ag_concat_rows(a, b))

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