pytorch
dea23378 - torch.Assert: make it torch.jit.script'able (#47399) (#47973)

Commit
4 years ago
torch.Assert: make it torch.jit.script'able (#47399) (#47973) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47973 Currently torch.Assert is not scriptable, which makes it not very useful for production code. According to jamesr66a , moving this to c++ op land will help with scriptability. This PR implements the change. Note: with the current code the Assert is scriptable but the Assert is a no-op after being scripted. Would love suggestions on how to address that (can be in future PR). Test Plan: ``` python test/test_utils.py TestAssert.test_assert_scriptable python test/test_utils.py TestAssert.test_assert_true python test/test_fx.py TestFX.test_symbolic_trace_assert ``` Reviewed By: supriyar Differential Revision: D24974299 Pulled By: vkuzo fbshipit-source-id: 20d4f4d8ac20d76eee122f2cdcdcdcaf1cda3afe
Author
Parents
Loading