Torch.flatten() returns a 1-dim tensor on a 0-dim tensor (#25406)
Summary:
PR for `torch.flatten()` to return a 1-dim tensor on a 0-dim tensor
> torch.tensor(123).shape -> torch.Size([])
> torch.tensor(123).flatten() -> torch.tensor([123])
> torch.tensor(123).flatten().shape -> torch.Size([1])
resolve https://github.com/pytorch/pytorch/issues/22963
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25406
Differential Revision: D17120464
Pulled By: CamiWilliams
fbshipit-source-id: efbecd61f0aefd82f2ab417ca6bb467488ff99de