Add parsing to file check (#18304)
authorElias Ellison <eellison@fb.com>
Thu, 28 Mar 2019 01:11:45 +0000 (18:11 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 28 Mar 2019 01:16:05 +0000 (18:16 -0700)
commit0daafe02098825842fbe5d1682e88e63ae6868c1
tree9335eaf0dea96f25c4119a026ed2403f1e5efc69
parentad1ebf70827e367c8d0eae8852e11f2289301607
Add parsing to file check (#18304)

Summary:
This allows you to embed checks in IR, making the test more readable.

E.g.
```
graph_str = 'graph(%0 : Double(5, 5)):
          # CHECK: aten::relu
          %1 : Double(5, 5) = aten::relu(%0)
          return (%1)'
FileCheck().run(graph_str, parseIR(graph_str))
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18304

Differential Revision: D14652372

Pulled By: eellison

fbshipit-source-id: 7430b9d1dc2b7584704375aac02d7392ecec76a0
test/cpp/jit/test_irparser.h
test/test_jit.py
torch/csrc/jit/init.cpp
torch/csrc/jit/script/init.cpp
torch/csrc/jit/testing/file_check.cpp
torch/csrc/jit/testing/file_check.h