Use new_empty in dropout (#72078)
Summary:
This will be needed by functorch to have the expected behavior of randomness:
Dropout generates a tensor of the right size and then calls `bernoulli_` on that. In order to get the expected behavior from ensembled creation, we'll need to make sure that the generated tensor is a batched tensor.This works mostly because most tensors are created as `empty_like` but this one just creates `empty` because it needs a new shape, only for feature dropout. There is also no analogous version in CUDA because this directly calls`_dropout_impl` here (not in native_functions.yaml)
This shouldn't change the behavior outside of functorch
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72078
Reviewed By: zou3519
Differential Revision: D33898338
Pulled By: samdow
fbshipit-source-id: 9d9ed59d138d732d9647b2771ccf2ea97cffae1c
(cherry picked from commit e51cf3ebf2c80a65296c7513576042dd58e0de28)