Pin onnx ir_version to 4 (#18768)
authorLu Fang <lufang@fb.com>
Wed, 3 Apr 2019 20:08:21 +0000 (13:08 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 20:16:59 +0000 (13:16 -0700)
Summary:
to make test_operators.py more stable. in future, we will bump this up manually, and I think it's acceptable, since ir_version should be bumped too often.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18768

Reviewed By: zrphercule

Differential Revision: D14741514

Pulled By: houseroad

fbshipit-source-id: 0369dbc55424e345a113e49fc104a441ea290d58

torch/csrc/jit/export.cpp

index 4112aa9..7e2a63f 100644 (file)
@@ -189,7 +189,10 @@ EncoderBase::EncoderBase(
       operator_export_type_(operator_export_type),
       strip_doc_(strip_doc) {
   model_proto_.set_producer_name("pytorch");
-  model_proto_.set_ir_version(onnx::IR_VERSION);
+  // we pin IR version to version 4 (01/22/2019) instead of using
+  // onnx::IR_VERSION. with this change, the test_operators.py will be more
+  // stable. only bump it when it's necessary
+  model_proto_.set_ir_version(4);
   // TODO: set the producer version using appropriate function call
   model_proto_.set_producer_version("1.1");
 }