Add self to Python printer reserved words (#15318)
authorDavid Riazati <davidriazati@fb.com>
Thu, 20 Dec 2018 10:25:20 +0000 (02:25 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 20 Dec 2018 10:29:09 +0000 (02:29 -0800)
commit5e624948b65ff32f927eed7e4fa1002b4113f8c1
tree6fd9590eb2ec28953daef4cfa55a0dad397158ce
parenteb5d28ecefb9d78d4fff5fac099e70e5eb3fbe2e
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: D13498974

Pulled By: driazati

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