XLA is a high-performance compiler for machine-learning computations. Enable it after debugging in the R runtime: compilation can improve execution speed, but the first call takes longer while the function is compiled; later calls reuse it. section 3.3.1
Compile a dense operation
dense <- tf_function(jit_compile = TRUE, \\(inputs, W, b) {\n tf$nn$relu(tf$matmul(inputs, W) + b)\n}) section 3.3.1
dense <- tf_function(jit_compile = TRUE, \(inputs, W, b) {
tf$nn$relu(tf$matmul(inputs, W) + b)
})
This listing shows the R syntax for enabling XLA compilation on a TensorFlow function. section 3.3.1


