# NOT RUN {
if (torch_is_installed()) {
input = torch_randint(0, 8, list(5), dtype=torch_int64())
weights = torch_linspace(0, 1, steps=5)
input
weights
torch_bincount(input, weights)
input$bincount(weights)
}
# }
Run the code above in your browser using DataLab