# \donttest{
# One convolution shared between two sequence inputs.
shared <- ggml_conv_1d_layer(filters = 4L, kernel_size = 3L)
x1 <- ggml_input(shape = c(16L, 2L))
x2 <- ggml_input(shape = c(16L, 2L))
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