Revert D24395956: [pytorch][PR] Replace flatten tensors with flatten loops.
Test Plan: revert-hammer
Differential Revision:
D24395956 (https://github.com/pytorch/pytorch/commit/2f51ddb81f370989bfd65c36222cd134a997b42c)
Original commit changeset: f3792903f206
fbshipit-source-id: ef70713f0f67f577b09674219631d22440ceec31