From fc4f33b08f23f706da84bd7726e056331dc224fe Mon Sep 17 00:00:00 2001 From: Elias Ellison Date: Fri, 8 Feb 2019 19:06:41 -0800 Subject: [PATCH] Add suggest add to __constants__ message on save fail Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16850 Differential Revision: D14014735 Pulled By: eellison fbshipit-source-id: 7b6d5d5b64b9b107743cea1548cb4ee1b653977e --- torch/csrc/jit/passes/python_print.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torch/csrc/jit/passes/python_print.cpp b/torch/csrc/jit/passes/python_print.cpp index f7ef06f..7925917 100644 --- a/torch/csrc/jit/passes/python_print.cpp +++ b/torch/csrc/jit/passes/python_print.cpp @@ -713,7 +713,8 @@ struct PythonPrintPass { if (enforce_importable_) { throw script::ErrorReport(node->getSourceLocation()) << "could not export python function call " << value->name() - << ". Remove calls to Python functions before export"; + << ". Remove calls to Python functions before export." + << "Did you forget add @script annotation? If this is a modulelist, add it to __constants__."; } stmt << "^" << value->name(); -- 2.7.4