Add a decomposition for torch.put, 2. (#120179)
As in the title. It is an updated copy of https://github.com/pytorch/pytorch/pull/115306 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/120179
Approved by: https://github.com/lezcano, https://github.com/peterbell10, https://github.com/jgong5