Add self to Python printer reserved words (#15318)
authorDavid Riazati <davidriazati@fb.com>
Fri, 21 Dec 2018 23:59:29 +0000 (15:59 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 22 Dec 2018 00:02:07 +0000 (16:02 -0800)
commit1dcf2ea0963ece881cd95841e1db8ac920544e15
tree487200f2d25a02f0899cc6ae4240c175a4452191
parent70aafad08a9e01f4de04cfe6a486556c1c201a58
Add self to Python printer reserved words (#15318)

Summary:
This adds `self` to the list of reserved words and also sorts the lines and prevents the tracer from naming values 'self' (which happens in torch/tensor.py)

Fixes #15240
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15318

Differential Revision: D13540192

Pulled By: driazati

fbshipit-source-id: 46ae02e51b1b31d5c62110fa83ba258ea6bada27
test/onnx/expect/TestOperators.test_norm.expect
torch/csrc/jit/passes/python_print.cpp
torch/jit/__init__.py