Fix scalar handling of unfold. (#28462)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28462
Unfold is implemented in TH (as _th_unfold), and uses the standard scalar checks. That means, even though torch.tensor(5).unfold(dim=0, size=1, step=1) should produce:
torch.tensor([5]), it actually produces torch.tensor(5) because the scalar_check infers it's a scalar.
We can fix this by just turning off the scalar_check.
Test Plan: Imported from OSS
Differential Revision: D18074671
Pulled By: gchanan
fbshipit-source-id: 5db09d614692830d66d6e6d8aba799ebe8144cf5