Pin onnx ir_version to 4 (#18768)

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
This commit is contained in:
Lu Fang
2019-04-03 13:08:21 -07:00
committed by Facebook Github Bot
parent 8711df89cc
commit 3b71f2e1f2

View 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");
}