# NOT RUN {
if (torch_is_installed()) {
# pool of square window of size=3, stride=2
m <- nn_avg_pool2d(3, stride=2)
# pool of non-square window
m <- nn_avg_pool2d(c(3, 2), stride=c(2, 1))
input <- torch_randn(20, 16, 50, 32)
output <- m(input)
}
# }
Run the code above in your browser using DataLab