# NOT RUN {
if (torch_is_installed()) {
# }
# NOT RUN {
x = torch_tensor(c(1, 2, 3))
x$repeat_interleave(2)
y = torch_tensor(matrix(c(1, 2, 3, 4), ncol = 2, byrow=TRUE))
torch_repeat_interleave(y, 2)
torch_repeat_interleave(y, 3, dim=1)
torch_repeat_interleave(y, torch_tensor(c(1, 2)), dim=1)
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataLab