提交 9b7c3f96 编写于 作者: X Xin Pan

refine

上级 ff47eaf4
...@@ -19,6 +19,11 @@ limitations under the License. */ ...@@ -19,6 +19,11 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace framework { namespace framework {
// Note:
// Program and Tensor that pass the IsXXXVersionSupported should
// be supported by the current codes. Otherwise, it's a compatibility
// bug.
// The program version the current codes generate. // The program version the current codes generate.
constexpr int64_t kCurProgramVersion = 0; constexpr int64_t kCurProgramVersion = 0;
...@@ -27,8 +32,11 @@ constexpr int64_t kCurProgramVersion = 0; ...@@ -27,8 +32,11 @@ constexpr int64_t kCurProgramVersion = 0;
constexpr int64_t kSupportedProgramVersion[] = {0}; constexpr int64_t kSupportedProgramVersion[] = {0};
// Due to historical reasons, tensor version use uint32_t. // Due to historical reasons, tensor version use uint32_t.
// The tensor version the current codes generate.
constexpr uint32_t kCurTensorVersion = 0; constexpr uint32_t kCurTensorVersion = 0;
// The tensor version that was generated by previous or current codes
// and supported by current codes.
constexpr uint32_t kSupportedTensorVersion[] = {0}; constexpr uint32_t kSupportedTensorVersion[] = {0};
bool IsProgramVersionSupported(int64_t version); bool IsProgramVersionSupported(int64_t version);
......
...@@ -750,7 +750,6 @@ def load_inference_model(dirname, ...@@ -750,7 +750,6 @@ def load_inference_model(dirname,
program_desc_str = f.read() program_desc_str = f.read()
program = Program.parse_from_string(program_desc_str) program = Program.parse_from_string(program_desc_str)
# TODO(panyx0718): Link to our version and compatibility guide.
if not core._is_program_version_supported(program._version()): if not core._is_program_version_supported(program._version()):
raise ValueError("Unsupported program version: %d\n" % raise ValueError("Unsupported program version: %d\n" %
program._version()) program._version())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册