make test module hook use save/load (#18284)
authorMichael Suo <suo@fb.com>
Wed, 3 Apr 2019 01:06:07 +0000 (18:06 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 01:09:52 +0000 (18:09 -0700)
commit31849bc524697c266552e1bd091ba9085f98494b
tree645a42c07c6b5b5474560d968f0dccc2a0b3f842
parent2d07993bcbed8aec20d09c9192d30c4eefeb1507
make test module hook use save/load (#18284)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18284
ghimport-source-id: 5a92c03fda19072ffb6afd40e0f56806716c7be6

Stack from [ghstack](https://github.com/ezyang/ghstack):
* #18296 [jit] Add namespacing for ScriptClasses
* **#18284 [jit] make test module hook use save/load**
* #18211 [jit] Turn script_type_parser into a class
* #18148 [jit] python interop for script classes

Instead of python-printing and comparing strings (which does not capture
depdency information, etc.), use save/load on in-memory buffers and
compare the main module contents inside the buffer

Reviewed By: ailzhang

Differential Revision: D14581129

fbshipit-source-id: 52264ae9ce076775ab3fd1a0c32c8d6f6677a903
test/test_jit.py