Environment variable for controlling type verbosity in debug output (#41906)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41906
Fixes #41770
Test Plan:
Example:
```
import torch
def bar():
def test(a):
return a
x = torch.ones(10,10, device='cpu')
print(torch.jit.trace(test, (x)).graph)
bar()
```
Bash:
```
for i in 0 1 2 3; do
PYTORCH_JIT_TYPE_VERBOSITY=$i python test.py
done
```
Output:
```
graph(%0):
return (%0)
graph(%0 : Float(10, 10)):
return (%0)
graph(%0 : Float(10:10, 10:1)):
return (%0)
graph(%0 : Float(10:10, 10:1, requires_grad=0, device=cpu)):
return (%0)
```
Imported from OSS
Reviewed By: ZolotukhinM
Differential Revision: D22687966
fbshipit-source-id: cd395257d79a4baa35245c778a74a55d1ea2a842