Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-703] Describe onnx opsets and major version
Browse files Browse the repository at this point in the history
  • Loading branch information
KellenSunderland committed Jan 14, 2019
1 parent 557eddb commit a1030a2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/operator/contrib/nnvm_to_onnx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,19 @@ op::ONNXParam ConvertNnvmGraphToOnnx(
}

ModelProto model_proto;
// Need to determine IR versions and features to support

// We're currently serializing our models in ONNX 3, opset 8 as it is best supported by the
// currently linked version of the onnx-tensorrt library.
// More information on ONNX versions and opsets can be found at:
// https://github.com/onnx/onnx/blob/master/docs/IR.md

auto opset_proto = model_proto.add_opset_import();
opset_proto->set_version(static_cast<int64>(8));
model_proto.set_ir_version(static_cast<int64>(3));
const int64 onnx_opset = 8;
const int64 onnx_major_version = 3;

// Declare our ONNX versions in our protobuf model.
opset_proto->set_version(onnx_opset);
model_proto.set_ir_version(onnx_major_version);

GraphProto* graph_proto = model_proto.mutable_graph();
auto subgraph_name_id = subgraph_count.fetch_add(1);
Expand Down

0 comments on commit a1030a2

Please sign in to comment.