| 1 | // |
| 2 | // WARNING: This file is automatically generated! Please edit onnx.in.proto. |
| 3 | // |
| 4 | |
| 5 | |
| 6 | // Copyright (c) ONNX Project Contributors. |
| 7 | // Licensed under the Apache-2.0 license. |
| 8 | |
| 9 | syntax = "proto2"; |
| 10 | |
| 11 | package onnx; |
| 12 | import "onnx-ml.proto"; |
| 13 | |
| 14 | // |
| 15 | // This file contains the proto definitions for OperatorSetProto and |
| 16 | // OperatorProto. OperatorSetProtos are used to describe a versioned |
| 17 | // set of operators that can be used by a ModelProto. |
| 18 | // |
| 19 | // Like ModelProto, OperatorSetProto is defined as a top-level file/wire |
| 20 | // format, however their usage is different. |
| 21 | // |
| 22 | // ModelProto files are used to describe executable graphs that can be |
| 23 | // executed directly by a framework, runtime, or engine. |
| 24 | // |
| 25 | // OperatorSetProto files are used to describe a set of operators that are |
| 26 | // available in a given environment. The file TBD.TBD is the OperatorSetProto |
| 27 | // that describes the ONNX standard operators. |
| 28 | // |
| 29 | |
| 30 | // An OperatorProto represents the immutable specification of the signature |
| 31 | // and semantics of an operator. |
| 32 | // |
| 33 | // Operators are declared as part of an OperatorSet, which also defines the |
| 34 | // domain name for the set. |
| 35 | // |
| 36 | // Operators are uniquely identified by a three part identifier |
| 37 | // (domain, op_type, since_version) |
| 38 | // where |
| 39 | // *domain* is the domain of an operator set that |
| 40 | // contains this operator specification. |
| 41 | // |
| 42 | // *op_type* is the name of the operator as referenced by a |
| 43 | // NodeProto.op_type |
| 44 | // |
| 45 | // *since_version* is the version of the operator set that |
| 46 | // this operator was initially declared in. |
| 47 | // |
| 48 | message OperatorProto { |
| 49 | // The name of the operator within a domain. |
| 50 | // This field MUST be present in this version of the IR. |
| 51 | optional string op_type = 1; |
| 52 | |
| 53 | // The version of the operator set that first introduced this |
| 54 | // operator. This value MUST be the same value as the |
| 55 | // opset_version of the operator set that first published this operator. |
| 56 | // Subsequent versions of the operator set MUST NOT alter the signature |
| 57 | // or semantics of the operator once published as STABLE. |
| 58 | // This field MUST be present in this version of the IR. |
| 59 | optional int64 since_version = 2; |
| 60 | |
| 61 | // This field indicates whether the syntax, semantics, or presence |
| 62 | // of this operator is in an experimental or stable stage. Once an |
| 63 | // operator is published as STABLE, it's syntax and semantics MUST NOT |
| 64 | // change in subsequent versions of the operator set. |
| 65 | // When an operator is published as EXPERIMENTAL, the syntax and semantics |
| 66 | // of the operator MAY change across operator set versions. |
| 67 | // Operators "become" stable by deprecating the experimental version and |
| 68 | // introducing a new stable operator with the same op_type. |
| 69 | optional OperatorStatus status = 3; |
| 70 | |
| 71 | // Eventually we will declare the signature of the operator here |
| 72 | |
| 73 | // A human-readable documentation for this operator. Markdown is allowed. |
| 74 | optional string doc_string = 10; |
| 75 | } |
| 76 | |
| 77 | // An OperatorSetProto represents an immutable set of immutable operator |
| 78 | // specifications. |
| 79 | // |
| 80 | // The domain of the set (OperatorSetProto.domain) is a reverse-DNS name |
| 81 | // that disambiguates operator sets defined by independent entities. |
| 82 | // |
| 83 | // The version of the set (opset_version) is a monotonically increasing |
| 84 | // integer that indicates changes to the membership of the operator set. |
| 85 | // |
| 86 | // |
| 87 | // Operator sets are uniquely identified by a two part identifier (domain, opset_version) |
| 88 | // |
| 89 | // Like ModelProto, OperatorSetProto is intended as a top-level file/wire format, |
| 90 | // and thus has the standard format headers in addition to the operator set information. |
| 91 | // |
| 92 | message OperatorSetProto { |
| 93 | // All OperatorSetProtos start with a distingushed byte sequence to disambiguate |
| 94 | // protobuf files containing OperatorSets from other content. |
| 95 | // This field MUST be "ONNXOPSET" |
| 96 | // This field MUST be present in this version of the IR |
| 97 | optional string magic = 1; |
| 98 | |
| 99 | // All OperatorSetProtos indicate the version of the IR syntax and semantics |
| 100 | // they adhere to. It is always IR_VERSION. |
| 101 | // This field MUST be present in this version of the IR |
| 102 | optional int64 ir_version = 2; |
| 103 | |
| 104 | // The prerelease component of the SemVer of the IR. |
| 105 | // This field MAY be absent in this version of the IR |
| 106 | optional string ir_version_prerelease = 3; |
| 107 | |
| 108 | // The build metadata component of the SemVer of the IR. |
| 109 | // This field MAY be absent in this version of the IR |
| 110 | optional string ir_build_metadata = 7; |
| 111 | |
| 112 | // Domain name of the operator set, in reverse DNS form (e.g., com.acme.dnnops). |
| 113 | optional string domain = 4; |
| 114 | |
| 115 | // The version of the set of operators. This is a simple int value |
| 116 | // that is monotonically increasing as new versions of the operator set |
| 117 | // are published. All operators in this set MUST have since_version |
| 118 | // <= opset_version. |
| 119 | optional int64 opset_version = 5; |
| 120 | |
| 121 | // A human-readable documentation for this set of operators. Markdown is allowed. |
| 122 | optional string doc_string = 6; |
| 123 | |
| 124 | // The operators specified by this operator set. |
| 125 | // The (name, version) MUST be unique across all OperatorProtos in operator |
| 126 | repeated OperatorProto operator = 8; |
| 127 | |
| 128 | // The functions specified by this operator set. |
| 129 | // The (name, version) MUST be unique across all OperatorProtos/FunctionProtos in operator/functions |
| 130 | repeated FunctionProto functions = 9; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | // For using protobuf-lite |
| 135 | option optimize_for = LITE_RUNTIME; |
| 136 | |