# \donttest{
w <- ag_param(matrix(c(1, 0, 0, 1), 2, 2))
x <- ag_tensor(matrix(c(1, 2), 2, 1))
y <- ag_tensor(matrix(c(1, 2), 2, 1))
with_grad_tape({
out <- ag_matmul(w, x)
loss <- ag_mse_loss(out, y)
})
backward(loss)
# }
Run the code above in your browser using DataLab