# \donttest{
# One convolution shared between two inputs.
shared <- ggml_conv_2d_layer(filters = 4L, kernel_size = 3L, activation = "relu")
x1 <- ggml_input(shape = c(8L, 8L, 1L))
x2 <- ggml_input(shape = c(8L, 8L, 1L))
o1 <- ggml_apply(x1, shared)
o2 <- ggml_apply(x2, shared)
stopifnot(identical(o1$layer_id, o2$layer_id)) # same weights
# }
Run the code above in your browser using DataLab