Add suport for tensor targets in for-in (#19380)
Summary:
Fixes #19314
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19380
Differential Revision: D15167858
Pulled By: Krovatkin
fbshipit-source-id: e87261bbf3e6f8df0601df80280eb3dba42798cd