Strip doc_string from exported ONNX models (#18882)
authorLara Haidar-Ahmad <lahaidar@microsoft.com>
Fri, 19 Apr 2019 05:25:04 +0000 (22:25 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 19 Apr 2019 05:30:00 +0000 (22:30 -0700)
commit9983c24cfcad8e091f55fc728999ca7d5a2d7c65
treee8cb9896bf19589a7562e53c6dc90d8d8c154e92
parentf0d98199fb1f20b8a22a645f50b5410d9392a864
Strip doc_string from exported ONNX models (#18882)

Summary:
Strip the doc_string by default from the exported ONNX models (this string has the stack trace and information about the local repos and folders, which can be confidential).

The users can still generate the doc_string by specifying add_doc_string=True in torch.onnx.export().
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18882

Differential Revision: D14889684

Pulled By: houseroad

fbshipit-source-id: 26d2c23c8dc3f484544aa854b507ada429adb9b8
test/onnx/test_utility_funs.py
torch/csrc/jit/export.cpp
torch/csrc/jit/export.h
torch/csrc/jit/python_ir.cpp
torch/onnx/utils.py