pytorch/test/cpp
Ailing Zhang 6842da6251 [WIP]Relax some limitations of InferenceMode. (#54403)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54403

A few important points about InferenceMode behavior:
1. All tensors created in InferenceMode are inference tensors except for view ops.
   - view ops produce output has the same is_inference_tensor property as their input.
     Namely view of normal tensor inside InferenceMode produce a normal tensor, which is
     exactly the same as creating a view inside NoGradMode. And view of
     inference tensor outside InferenceMode produce inference tensor as output.
2. All ops are allowed inside InferenceMode, faster than normal mode.
3. Inference tensor cannot be saved for backward.

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D27316483

Pulled By: ailzhang

fbshipit-source-id: e03248a66d42e2d43cfe7ccb61e49cc4afb2923b
2021-04-09 14:40:37 -07:00
..
api [WIP]Relax some limitations of InferenceMode. (#54403) 2021-04-09 14:40:37 -07:00
common
dist_autograd Forbid trailing whitespace (#53406) 2021-03-05 17:22:55 -08:00
jit [PyTorch] Lite interpreter with a backend delegate (#54462) 2021-04-06 00:55:26 -07:00
lite_interpreter_runtime [PyTorch] Lite interpreter with a backend delegate (#54462) 2021-04-06 00:55:26 -07:00
rpc Transition to new tensorpipe::Pipe API. (#55193) 2021-04-02 02:28:07 -07:00
tensorexpr Update to short forms of splitWithTail / splitWithMask (#55542) 2021-04-09 10:15:20 -07:00
__init__.py