Make static dispatch turn off variable before entering the kernel. (#26908)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26908
This is because in static dispatch, variable is not supported. But
you might still "have" a variable somehow (e.g., in JIT initialization
code), so we need to translate between the two worlds.
Attempt to fix #26764
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Differential Revision: D17607550
Pulled By: ezyang
fbshipit-source-id: ea2cb931215d749efd95259ad7a1a8ae96c38aed