pytorch pass array of indices code example Example: tensor.numpy() pytorch gpu tensor_array.cpu().detach().numpy()