ggml_are_same_layout: Check if Two Tensors Have the Same Layout

View source: R/graph.R

ggml_are_same_layoutR Documentation

Check if Two Tensors Have the Same Layout

Description

Compares two tensors to check if they have identical type, shape, and strides. Tensors with the same layout can be used interchangeably for memory operations.

Usage

ggml_are_same_layout(a, b)

Arguments

a

External pointer to first tensor

b

External pointer to second tensor

Value

Logical indicating if tensors have identical layout

See Also

Other tensor: ggml_get_op_params(), ggml_get_op_params_f32(), ggml_get_op_params_i32(), ggml_set_op_params(), ggml_set_op_params_f32(), ggml_set_op_params_i32()

Examples


ctx <- ggml_init(1024 * 1024)
a <- ggml_new_tensor_2d(ctx, GGML_TYPE_F32, 4, 4)
b <- ggml_new_tensor_2d(ctx, GGML_TYPE_F32, 4, 4)
same <- ggml_are_same_layout(a, b)  # TRUE
ggml_free(ctx)


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