0/1 Knapsack Problem in PyTorch