forked from pool/python-onnx
Accepting request 872639 from science:machinelearning
OBS-URL: https://build.opensuse.org/request/show/872639 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-onnx?expand=0&rev=10
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d68a5471bcd70eb23ace39717d0177a6273ab9ea51064892a0ba589b73b619ac
|
||||
size 4831515
|
3
onnx-1.8.1.tar.gz
Normal file
3
onnx-1.8.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0054c7eeed97e8ee43921c3f944b0450782a081d910a14b3b6e662bc87065192
|
||||
size 4934809
|
@@ -1,3 +1,39 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 15 18:25:39 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- NEP 29: Tumbleweed does not have python36-numpy and depending
|
||||
packages anymore. Skip python36 build.
|
||||
- Make setup.py cmake call and %cmake macros compatible, even for
|
||||
multiple python3 flavors (when we get python39)
|
||||
- Fix boo#1182258
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 5 08:50:45 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1
|
||||
* Bug fixes:
|
||||
- #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling
|
||||
- #3171 Fix bugs in external data helpers and add add size thresholds for converting
|
||||
- #2961 Fix build issues on some distributions of linux due to hard dependency on python2
|
||||
- #3221 Fix mypy wrapper error while using ONNX as a submodule
|
||||
- Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0
|
||||
* Training
|
||||
- Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954
|
||||
- Removed GraphCall; eliminated need to implement GraphCall #2964
|
||||
- Created a tool and example for users to use TrainingInfoProto for training #3008
|
||||
* Shape Inference and Checker
|
||||
- Large model (>2GB model) support added for checker and shape_inference #2744
|
||||
- Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023
|
||||
- Node level shape inference fixes for operators
|
||||
* Version Converter
|
||||
- More operators supported #2664
|
||||
* General Features
|
||||
- Added serialization for inputs and outputs of Sequence and Map data types #2581
|
||||
- Added programmatic access to version-table and extend make-model #2918
|
||||
- Added size check to make_tensor #2987
|
||||
- Drop patch as the related problem has been fixed upstream:
|
||||
* using-onnxruntime-proto.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 14 14:05:18 UTC 2020 - Christian Goll <cgoll@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-onnx
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -18,8 +18,10 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define skip_python2 1
|
||||
# Tumbleweed does not have a python36-numpy anymore: NEP 29 dropped Python 3.6 for NumPy 1.20
|
||||
%define skip_python36 1
|
||||
Name: python-onnx
|
||||
Version: 1.7.0
|
||||
Version: 1.8.1
|
||||
Release: 0
|
||||
Summary: Open Neural Network eXchange
|
||||
License: MIT
|
||||
@@ -27,7 +29,6 @@ URL: https://onnx.ai/
|
||||
Source0: https://github.com/onnx/onnx/archive/v%{version}.tar.gz#/onnx-%{version}.tar.gz
|
||||
Source1: %{name}-rpmlintrc
|
||||
Patch1: no-python2.patch
|
||||
Patch2: using-onnxruntime-proto.patch
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module protobuf}
|
||||
@@ -50,7 +51,7 @@ Requires: python-protobuf
|
||||
Requires: python-six
|
||||
Requires: python-typing_extensions >= 3.6.2.1
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Requires(postun):update-alternatives
|
||||
Provides: python-onnx-devel = %{version}-%{release}
|
||||
Obsoletes: python-onnx-devel < %{version}-%{release}
|
||||
%python_subpackages
|
||||
@@ -68,7 +69,7 @@ Requires: libonnx_proto == %version
|
||||
Requires: libonnxifi_dummy == %version
|
||||
|
||||
%description -n onnx-devel
|
||||
Header files of ONNX.
|
||||
Header files of ONNX.
|
||||
|
||||
%package -n libonnxifi_dummy
|
||||
Summary: Library for ONNX Interface for Framework Integration
|
||||
@@ -97,37 +98,26 @@ Summary: Test data
|
||||
%description -n onnx-backend-test
|
||||
This packages includes the data for testing the backend.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n onnx-%{version}
|
||||
# avoid bundles
|
||||
rm -rf third_party
|
||||
%autopatch -p1
|
||||
# say that the cmake was already built (we used our macros)
|
||||
sed -i -e 's:built = False:built = True:g' setup.py
|
||||
# build inside python_expand shuffled build dir also used by the cmake macro instead of upstream's custom dirname
|
||||
sed -i "/^CMAKE_BUILD_DIR = / s/TOP_DIR, '.setuptools-cmake-build'/TOP_DIR, 'build'/" setup.py
|
||||
# do not require extra pytest modules
|
||||
sed -i -e '/addopts/d' setup.cfg
|
||||
# do not pull in pytest-runner as it is deprecated
|
||||
sed -i -e '/pytest-runner/d' setup.py
|
||||
|
||||
%build
|
||||
# define same folder like is used for the setup.py later
|
||||
%define __builddir .setuptools-cmake-build
|
||||
# FIXME: you should use %%cmake macros
|
||||
# Force the cmake to build static libs as otherwise we end
|
||||
# up with unresolvable package.
|
||||
%{python_expand # we need to generate for each python
|
||||
%cmake \
|
||||
-DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
|
||||
-DONNX_WERROR=OFF \
|
||||
-DBUILD_ONNX_PYTHON=ON \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=OFF \
|
||||
-DPYTHON_EXECUTABLE="%{_bindir}/$python" \
|
||||
-DPY_EXT_SUFFIX="`$python-config --extension-suffix`" \
|
||||
%{nil}
|
||||
%cmake_build ; cd ..
|
||||
%{python_expand # Generate the build system using the distro macro, configuring everything to taste for every python flavor.
|
||||
%cmake -DONNX_USE_PROTOBUF_SHARED_LIBS:BOOL=ON \
|
||||
-DONNX_WERROR:BOOL=OFF
|
||||
# the macro stays in build/
|
||||
cd ..
|
||||
}
|
||||
# let setup.py do the cmake build call (for every flavor)
|
||||
%python_build
|
||||
|
||||
%install
|
||||
@@ -136,19 +126,34 @@ sed -i -e '/pytest-runner/d' setup.py
|
||||
%python_clone -a %{buildroot}%{_bindir}/backend-test-tools
|
||||
%python_clone -a %{buildroot}%{_bindir}/check-node
|
||||
%python_clone -a %{buildroot}%{_bindir}/check-model
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
shebang_files="%{python_sitearch}/onnx/backend/test/stat_coverage.py %{python_sitearch}/onnx/defs/gen_doc.py %{python_sitearch}/onnx/gen_proto.py"
|
||||
%{python_expand # fix shebang
|
||||
shebang_files="%{$python_sitearch}/onnx/backend/test/stat_coverage.py %{$python_sitearch}/onnx/defs/gen_doc.py %{$python_sitearch}/onnx/gen_proto.py"
|
||||
for file in $shebang_files ; do
|
||||
sed -i 's@%{_bindir}/env python@%{_bindir}/python3@' %{buildroot}/$file
|
||||
sed -i 's|%{_bindir}/env python.*$|%{_bindir}/$python|' %{buildroot}/$file
|
||||
chmod 755 %{buildroot}/$file
|
||||
done
|
||||
}
|
||||
%{?python_compileall}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
# copy inplace for tests
|
||||
cp %{__builddir}/*cpp2py* ./onnx/
|
||||
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}"
|
||||
# copy tests into clean subdir and test the installed lib in sitearch
|
||||
mkdir cleantestdir
|
||||
cp -r onnx/test onnx/examples cleantestdir/
|
||||
pushd cleantestdir
|
||||
# skip online tests
|
||||
%pytest_arch -n auto -k 'not (test_bvlc_alexnet_cpu or test_shufflenet_cpu or test_densenet121_cpu or test_squeezenet_cpu or test_inception_v1_cpu or test_vgg19_cpu or test_inception_v2_cpu or test_zfnet512_cpu or test_resnet50_cpu)'
|
||||
donttest=" test_bvlc_alexnet_cpu \
|
||||
or test_shufflenet_cpu \
|
||||
or test_densenet121_cpu \
|
||||
or test_squeezenet_cpu \
|
||||
or test_inception_v1_cpu \
|
||||
or test_vgg19_cpu \
|
||||
or test_inception_v2_cpu \
|
||||
or test_zfnet512_cpu \
|
||||
or test_resnet50_cpu"
|
||||
%pytest_arch -n auto -k "not ($donttest)" -ra
|
||||
popd
|
||||
|
||||
%post
|
||||
%python_install_alternative backend-test-tools
|
||||
@@ -183,6 +188,7 @@ cp %{__builddir}/*cpp2py* ./onnx/
|
||||
|
||||
%files -n libonnx
|
||||
%{_libdir}/libonnx.so
|
||||
|
||||
%files -n libonnx_proto
|
||||
%{_libdir}/libonnx_proto.so
|
||||
|
||||
|
@@ -1,533 +0,0 @@
|
||||
From c44269ae65d9585740ee7a3ea897401ddb7e2d51 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Goll <cgoll@suse.de>
|
||||
Date: Tue, 14 Jul 2020 12:01:55 +0200
|
||||
Subject: [PATCH] using onnxruntime proto
|
||||
|
||||
---
|
||||
onnx/onnx-ml.proto | 63 ++++++++++++++++++++++++++++-----
|
||||
onnx/onnx-ml.proto3 | 54 ++++++++++++++++++++++++++--
|
||||
onnx/onnx-operators-ml.proto | 55 -----------------------------
|
||||
onnx/onnx-operators-ml.proto3 | 53 ----------------------------
|
||||
onnx/onnx-operators.in.proto | 51 ---------------------------
|
||||
onnx/onnx.in.proto | 66 ++++++++++++++++++++++++++++++-----
|
||||
6 files changed, 164 insertions(+), 178 deletions(-)
|
||||
|
||||
diff --git a/onnx/onnx-ml.proto b/onnx/onnx-ml.proto
|
||||
index d946d92f..e3ce6063 100644
|
||||
--- a/onnx/onnx-ml.proto
|
||||
+++ b/onnx/onnx-ml.proto
|
||||
@@ -62,7 +62,7 @@ enum Version {
|
||||
_START_VERSION = 0;
|
||||
// The version field is always serialized and we will use it to store the
|
||||
// version that the graph is generated from. This helps us set up version
|
||||
- // control.
|
||||
+ // control.
|
||||
// For the IR, we are using simple numbers starting with 0x00000001,
|
||||
// which was the version we published on Oct 10, 2017.
|
||||
IR_VERSION_2017_10_10 = 0x0000000000000001;
|
||||
@@ -259,7 +259,7 @@ message TrainingInfoProto {
|
||||
optional GraphProto algorithm = 2;
|
||||
|
||||
// This field specifies the bindings from the outputs of "initialization" to
|
||||
- // some initializers in "ModelProto.graph.initializer" and
|
||||
+ // some initializers in "ModelProto.graph.initializer" and
|
||||
// the "algorithm.initializer" in the same TrainingInfoProto.
|
||||
// See "update_binding" below for details.
|
||||
//
|
||||
@@ -298,7 +298,7 @@ message TrainingInfoProto {
|
||||
// 3. The values must be output names of "algorithm".
|
||||
// 4. If an optional input of a graph is omitted when using GraphCall, the
|
||||
// global variable with the same name may be used.
|
||||
- // 5. When using GraphCall, the users always can pass values to optional
|
||||
+ // 5. When using GraphCall, the users always can pass values to optional
|
||||
// inputs of the called graph even if the associated initializers appears
|
||||
// as keys in "update_binding"s.
|
||||
// 6. The graphs in TrainingInfoProto's can use global variables as
|
||||
@@ -365,6 +365,9 @@ message ModelProto {
|
||||
// The parameterized graph that is evaluated to execute the model.
|
||||
optional GraphProto graph = 7;
|
||||
|
||||
+ // kezhan: This field is not in ONNX, and will be pushed into ONNX with good use cases in microsoft.
|
||||
+ repeated FunctionProto functions = 100;
|
||||
+
|
||||
// Named metadata values; keys should be distinct.
|
||||
repeated StringStringEntryProto metadata_props = 14;
|
||||
|
||||
@@ -396,8 +399,6 @@ message TensorAnnotation {
|
||||
repeated StringStringEntryProto quant_parameter_tensor_names = 2;
|
||||
}
|
||||
|
||||
-
|
||||
-
|
||||
// Graphs
|
||||
//
|
||||
// A graph defines the computational logic of a model and is comprised of a parameterized
|
||||
@@ -698,7 +699,6 @@ message TypeProto {
|
||||
SparseTensor sparse_tensor_type = 8;
|
||||
|
||||
Opaque opaque_type = 7;
|
||||
-
|
||||
}
|
||||
|
||||
// An optional denotation can be used to denote the whole
|
||||
@@ -723,7 +723,52 @@ message OperatorSetIdProto {
|
||||
optional int64 version = 2;
|
||||
}
|
||||
|
||||
+// Operator/function status.
|
||||
+enum OperatorStatus {
|
||||
+ EXPERIMENTAL = 0;
|
||||
+ STABLE = 1;
|
||||
+}
|
||||
|
||||
-// For using protobuf-lite
|
||||
-option optimize_for = LITE_RUNTIME;
|
||||
-
|
||||
+message FunctionProto {
|
||||
+ // The name of the function, similar usage of op_type in OperatorProto.
|
||||
+ optional string name = 1;
|
||||
+
|
||||
+ // The first version of a function set which contains this function.
|
||||
+ // When there's any breaking change for this function, the function set
|
||||
+ // contains the function needs to bump its version, and since_version of
|
||||
+ // the updated function will be changed to the updated function set version.
|
||||
+ optional int64 since_version = 2;
|
||||
+
|
||||
+ // This field indicates whether the syntax, semantics, or presence
|
||||
+ // of this function is in an experimental or stable stage. Once an
|
||||
+ // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
+ // change in subsequent versions of the operator set.
|
||||
+ // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
+ // of the function MAY change across operator set versions.
|
||||
+ // Functions "become" stable by deprecating the experimental version and
|
||||
+ // introducing a new stable function with the same name.
|
||||
+ optional OperatorStatus status = 3;
|
||||
+
|
||||
+ // The inputs and outputs of the function.
|
||||
+ repeated string input = 4;
|
||||
+ repeated string output = 5;
|
||||
+
|
||||
+ // The attributes of the function.
|
||||
+ repeated string attribute= 6;
|
||||
+
|
||||
+ // The nodes in the function.
|
||||
+ repeated NodeProto node = 7;
|
||||
+ // A human-readable documentation for this function. Markdown is allowed.
|
||||
+ optional string doc_string = 8;
|
||||
+
|
||||
+ // The OperatorSets this function body (graph) relies on.
|
||||
+ // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
+ // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
+ // with this field specified.
|
||||
+ //
|
||||
+ // All nodes in the function body (graph) will bind against the operator
|
||||
+ // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
+ // in the referenced operator sets. This means at most one version can be relied
|
||||
+ // for one domain.
|
||||
+ repeated OperatorSetIdProto opset_import = 9;
|
||||
+}
|
||||
diff --git a/onnx/onnx-ml.proto3 b/onnx/onnx-ml.proto3
|
||||
index f92b868a..76239ec1 100644
|
||||
--- a/onnx/onnx-ml.proto3
|
||||
+++ b/onnx/onnx-ml.proto3
|
||||
@@ -365,6 +365,9 @@ message ModelProto {
|
||||
// The parameterized graph that is evaluated to execute the model.
|
||||
GraphProto graph = 7;
|
||||
|
||||
+ // kezhan: This field is not in ONNX, and will be pushed into ONNX with good use cases in microsoft.
|
||||
+ repeated FunctionProto functions = 100;
|
||||
+
|
||||
// Named metadata values; keys should be distinct.
|
||||
repeated StringStringEntryProto metadata_props = 14;
|
||||
|
||||
@@ -724,6 +727,53 @@ message OperatorSetIdProto {
|
||||
}
|
||||
|
||||
|
||||
-// For using protobuf-lite
|
||||
-option optimize_for = LITE_RUNTIME;
|
||||
+// Operator/function status.
|
||||
+enum OperatorStatus {
|
||||
+ EXPERIMENTAL = 0;
|
||||
+ STABLE = 1;
|
||||
+}
|
||||
+
|
||||
+message FunctionProto {
|
||||
+ // The name of the function, similar usage of op_type in OperatorProto.
|
||||
+ string name = 1;
|
||||
+
|
||||
+ // The first version of a function set which contains this function.
|
||||
+ // When there's any breaking change for this function, the function set
|
||||
+ // contains the function needs to bump its version, and since_version of
|
||||
+ // the updated function will be changed to the updated function set version.
|
||||
+ int64 since_version = 2;
|
||||
+
|
||||
+ // This field indicates whether the syntax, semantics, or presence
|
||||
+ // of this function is in an experimental or stable stage. Once an
|
||||
+ // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
+ // change in subsequent versions of the operator set.
|
||||
+ // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
+ // of the function MAY change across operator set versions.
|
||||
+ // Functions "become" stable by deprecating the experimental version and
|
||||
+ // introducing a new stable function with the same name.
|
||||
+ OperatorStatus status = 3;
|
||||
+
|
||||
+ // The inputs and outputs of the function.
|
||||
+ repeated string input = 4;
|
||||
+ repeated string output = 5;
|
||||
+
|
||||
+ // The attributes of the function.
|
||||
+ repeated string attribute= 6;
|
||||
+
|
||||
+ // The nodes in the function.
|
||||
+ repeated NodeProto node = 7;
|
||||
+ // A human-readable documentation for this function. Markdown is allowed.
|
||||
+ string doc_string = 8;
|
||||
+
|
||||
+ // The OperatorSets this function body (graph) relies on.
|
||||
+ // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
+ // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
+ // with this field specified.
|
||||
+ //
|
||||
+ // All nodes in the function body (graph) will bind against the operator
|
||||
+ // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
+ // in the referenced operator sets. This means at most one version can be relied
|
||||
+ // for one domain.
|
||||
+ repeated OperatorSetIdProto opset_import = 9;
|
||||
+}
|
||||
|
||||
diff --git a/onnx/onnx-operators-ml.proto b/onnx/onnx-operators-ml.proto
|
||||
index 6ad6a254..088c4f84 100644
|
||||
--- a/onnx/onnx-operators-ml.proto
|
||||
+++ b/onnx/onnx-operators-ml.proto
|
||||
@@ -27,56 +27,6 @@ import "onnx/onnx-ml.proto";
|
||||
// that describes the ONNX standard operators.
|
||||
//
|
||||
|
||||
-// Operator/function status.
|
||||
-enum OperatorStatus {
|
||||
- EXPERIMENTAL = 0;
|
||||
- STABLE = 1;
|
||||
-}
|
||||
-
|
||||
-message FunctionProto {
|
||||
- // The name of the function, similar usage of op_type in OperatorProto.
|
||||
- optional string name = 1;
|
||||
-
|
||||
- // The first version of a function set which contains this function.
|
||||
- // When there's any breaking change for this function, the function set
|
||||
- // contains the function needs to bump its version, and since_version of
|
||||
- // the updated function will be changed to the updated function set version.
|
||||
- optional int64 since_version = 2;
|
||||
-
|
||||
- // This field indicates whether the syntax, semantics, or presence
|
||||
- // of this function is in an experimental or stable stage. Once an
|
||||
- // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
- // change in subsequent versions of the operator set.
|
||||
- // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
- // of the function MAY change across operator set versions.
|
||||
- // Functions "become" stable by deprecating the experimental version and
|
||||
- // introducing a new stable function with the same name.
|
||||
- optional OperatorStatus status = 3;
|
||||
-
|
||||
- // The inputs and outputs of the function.
|
||||
- repeated string input = 4;
|
||||
- repeated string output = 5;
|
||||
-
|
||||
- // The attributes of the function.
|
||||
- repeated string attribute= 6;
|
||||
-
|
||||
- // The nodes in the function.
|
||||
- repeated NodeProto node = 7;
|
||||
- // A human-readable documentation for this function. Markdown is allowed.
|
||||
- optional string doc_string = 8;
|
||||
-
|
||||
- // The OperatorSets this function body (graph) relies on.
|
||||
- // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
- // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
- // with this field specified.
|
||||
- //
|
||||
- // All nodes in the function body (graph) will bind against the operator
|
||||
- // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
- // in the referenced operator sets. This means at most one version can be relied
|
||||
- // for one domain.
|
||||
- repeated OperatorSetIdProto opset_import = 9;
|
||||
-}
|
||||
-
|
||||
// An OperatorProto represents the immutable specification of the signature
|
||||
// and semantics of an operator.
|
||||
//
|
||||
@@ -179,8 +129,3 @@ message OperatorSetProto {
|
||||
// The (name, version) MUST be unique across all OperatorProtos/FunctionProtos in operator/functions
|
||||
repeated FunctionProto functions = 9;
|
||||
}
|
||||
-
|
||||
-
|
||||
-// For using protobuf-lite
|
||||
-option optimize_for = LITE_RUNTIME;
|
||||
-
|
||||
diff --git a/onnx/onnx-operators-ml.proto3 b/onnx/onnx-operators-ml.proto3
|
||||
index f9a1e950..bff8de27 100644
|
||||
--- a/onnx/onnx-operators-ml.proto3
|
||||
+++ b/onnx/onnx-operators-ml.proto3
|
||||
@@ -27,56 +27,6 @@ import "onnx/onnx-ml.proto3";
|
||||
// that describes the ONNX standard operators.
|
||||
//
|
||||
|
||||
-// Operator/function status.
|
||||
-enum OperatorStatus {
|
||||
- EXPERIMENTAL = 0;
|
||||
- STABLE = 1;
|
||||
-}
|
||||
-
|
||||
-message FunctionProto {
|
||||
- // The name of the function, similar usage of op_type in OperatorProto.
|
||||
- string name = 1;
|
||||
-
|
||||
- // The first version of a function set which contains this function.
|
||||
- // When there's any breaking change for this function, the function set
|
||||
- // contains the function needs to bump its version, and since_version of
|
||||
- // the updated function will be changed to the updated function set version.
|
||||
- int64 since_version = 2;
|
||||
-
|
||||
- // This field indicates whether the syntax, semantics, or presence
|
||||
- // of this function is in an experimental or stable stage. Once an
|
||||
- // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
- // change in subsequent versions of the operator set.
|
||||
- // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
- // of the function MAY change across operator set versions.
|
||||
- // Functions "become" stable by deprecating the experimental version and
|
||||
- // introducing a new stable function with the same name.
|
||||
- OperatorStatus status = 3;
|
||||
-
|
||||
- // The inputs and outputs of the function.
|
||||
- repeated string input = 4;
|
||||
- repeated string output = 5;
|
||||
-
|
||||
- // The attributes of the function.
|
||||
- repeated string attribute= 6;
|
||||
-
|
||||
- // The nodes in the function.
|
||||
- repeated NodeProto node = 7;
|
||||
- // A human-readable documentation for this function. Markdown is allowed.
|
||||
- string doc_string = 8;
|
||||
-
|
||||
- // The OperatorSets this function body (graph) relies on.
|
||||
- // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
- // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
- // with this field specified.
|
||||
- //
|
||||
- // All nodes in the function body (graph) will bind against the operator
|
||||
- // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
- // in the referenced operator sets. This means at most one version can be relied
|
||||
- // for one domain.
|
||||
- repeated OperatorSetIdProto opset_import = 9;
|
||||
-}
|
||||
-
|
||||
// An OperatorProto represents the immutable specification of the signature
|
||||
// and semantics of an operator.
|
||||
//
|
||||
@@ -181,6 +131,3 @@ message OperatorSetProto {
|
||||
}
|
||||
|
||||
|
||||
-// For using protobuf-lite
|
||||
-option optimize_for = LITE_RUNTIME;
|
||||
-
|
||||
diff --git a/onnx/onnx-operators.in.proto b/onnx/onnx-operators.in.proto
|
||||
index 923fac92..25881229 100644
|
||||
--- a/onnx/onnx-operators.in.proto
|
||||
+++ b/onnx/onnx-operators.in.proto
|
||||
@@ -26,56 +26,6 @@ import "onnx/onnx.proto";
|
||||
// that describes the ONNX standard operators.
|
||||
//
|
||||
|
||||
-// Operator/function status.
|
||||
-enum OperatorStatus {
|
||||
- EXPERIMENTAL = 0;
|
||||
- STABLE = 1;
|
||||
-}
|
||||
-
|
||||
-message FunctionProto {
|
||||
- // The name of the function, similar usage of op_type in OperatorProto.
|
||||
- optional string name = 1;
|
||||
-
|
||||
- // The first version of a function set which contains this function.
|
||||
- // When there's any breaking change for this function, the function set
|
||||
- // contains the function needs to bump its version, and since_version of
|
||||
- // the updated function will be changed to the updated function set version.
|
||||
- optional int64 since_version = 2;
|
||||
-
|
||||
- // This field indicates whether the syntax, semantics, or presence
|
||||
- // of this function is in an experimental or stable stage. Once an
|
||||
- // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
- // change in subsequent versions of the operator set.
|
||||
- // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
- // of the function MAY change across operator set versions.
|
||||
- // Functions "become" stable by deprecating the experimental version and
|
||||
- // introducing a new stable function with the same name.
|
||||
- optional OperatorStatus status = 3;
|
||||
-
|
||||
- // The inputs and outputs of the function.
|
||||
- repeated string input = 4;
|
||||
- repeated string output = 5;
|
||||
-
|
||||
- // The attributes of the function.
|
||||
- repeated string attribute= 6;
|
||||
-
|
||||
- // The nodes in the function.
|
||||
- repeated NodeProto node = 7;
|
||||
- // A human-readable documentation for this function. Markdown is allowed.
|
||||
- optional string doc_string = 8;
|
||||
-
|
||||
- // The OperatorSets this function body (graph) relies on.
|
||||
- // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
- // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
- // with this field specified.
|
||||
- //
|
||||
- // All nodes in the function body (graph) will bind against the operator
|
||||
- // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
- // in the referenced operator sets. This means at most one version can be relied
|
||||
- // for one domain.
|
||||
- repeated OperatorSetIdProto opset_import = 9;
|
||||
-}
|
||||
-
|
||||
// An OperatorProto represents the immutable specification of the signature
|
||||
// and semantics of an operator.
|
||||
//
|
||||
@@ -178,4 +128,3 @@ message OperatorSetProto {
|
||||
// The (name, version) MUST be unique across all OperatorProtos/FunctionProtos in operator/functions
|
||||
repeated FunctionProto functions = 9;
|
||||
}
|
||||
-
|
||||
diff --git a/onnx/onnx.in.proto b/onnx/onnx.in.proto
|
||||
index 8bef6018..c239bd1d 100644
|
||||
--- a/onnx/onnx.in.proto
|
||||
+++ b/onnx/onnx.in.proto
|
||||
@@ -59,7 +59,7 @@ enum Version {
|
||||
_START_VERSION = 0;
|
||||
// The version field is always serialized and we will use it to store the
|
||||
// version that the graph is generated from. This helps us set up version
|
||||
- // control.
|
||||
+ // control.
|
||||
// For the IR, we are using simple numbers starting with 0x00000001,
|
||||
// which was the version we published on Oct 10, 2017.
|
||||
IR_VERSION_2017_10_10 = 0x0000000000000001;
|
||||
@@ -256,7 +256,7 @@ message TrainingInfoProto {
|
||||
optional GraphProto algorithm = 2;
|
||||
|
||||
// This field specifies the bindings from the outputs of "initialization" to
|
||||
- // some initializers in "ModelProto.graph.initializer" and
|
||||
+ // some initializers in "ModelProto.graph.initializer" and
|
||||
// the "algorithm.initializer" in the same TrainingInfoProto.
|
||||
// See "update_binding" below for details.
|
||||
//
|
||||
@@ -295,7 +295,7 @@ message TrainingInfoProto {
|
||||
// 3. The values must be output names of "algorithm".
|
||||
// 4. If an optional input of a graph is omitted when using GraphCall, the
|
||||
// global variable with the same name may be used.
|
||||
- // 5. When using GraphCall, the users always can pass values to optional
|
||||
+ // 5. When using GraphCall, the users always can pass values to optional
|
||||
// inputs of the called graph even if the associated initializers appears
|
||||
// as keys in "update_binding"s.
|
||||
// 6. The graphs in TrainingInfoProto's can use global variables as
|
||||
@@ -362,6 +362,9 @@ message ModelProto {
|
||||
// The parameterized graph that is evaluated to execute the model.
|
||||
optional GraphProto graph = 7;
|
||||
|
||||
+ // kezhan: This field is not in ONNX, and will be pushed into ONNX with good use cases in microsoft.
|
||||
+ repeated FunctionProto functions = 100;
|
||||
+
|
||||
// Named metadata values; keys should be distinct.
|
||||
repeated StringStringEntryProto metadata_props = 14;
|
||||
|
||||
@@ -393,8 +396,6 @@ message TensorAnnotation {
|
||||
repeated StringStringEntryProto quant_parameter_tensor_names = 2;
|
||||
}
|
||||
|
||||
-
|
||||
-
|
||||
// Graphs
|
||||
//
|
||||
// A graph defines the computational logic of a model and is comprised of a parameterized
|
||||
@@ -656,7 +657,7 @@ message TypeProto {
|
||||
optional TypeProto value_type = 2;
|
||||
};
|
||||
|
||||
-// #if ONNX-ML
|
||||
+ // #if ONNX-ML
|
||||
|
||||
message SparseTensor {
|
||||
// This field MUST NOT have the value of UNDEFINED
|
||||
@@ -693,13 +694,13 @@ message TypeProto {
|
||||
// The type of a map.
|
||||
Map map_type = 5;
|
||||
|
||||
-// #if ONNX-ML
|
||||
+ // #if ONNX-ML
|
||||
|
||||
SparseTensor sparse_tensor_type = 8;
|
||||
|
||||
Opaque opaque_type = 7;
|
||||
|
||||
-// #endif
|
||||
+ // #endif
|
||||
}
|
||||
|
||||
// An optional denotation can be used to denote the whole
|
||||
@@ -724,3 +725,52 @@ message OperatorSetIdProto {
|
||||
optional int64 version = 2;
|
||||
}
|
||||
|
||||
+// Operator/function status.
|
||||
+enum OperatorStatus {
|
||||
+ EXPERIMENTAL = 0;
|
||||
+ STABLE = 1;
|
||||
+}
|
||||
+
|
||||
+message FunctionProto {
|
||||
+ // The name of the function, similar usage of op_type in OperatorProto.
|
||||
+ optional string name = 1;
|
||||
+
|
||||
+ // The first version of a function set which contains this function.
|
||||
+ // When there's any breaking change for this function, the function set
|
||||
+ // contains the function needs to bump its version, and since_version of
|
||||
+ // the updated function will be changed to the updated function set version.
|
||||
+ optional int64 since_version = 2;
|
||||
+
|
||||
+ // This field indicates whether the syntax, semantics, or presence
|
||||
+ // of this function is in an experimental or stable stage. Once an
|
||||
+ // function is published as STABLE, its syntax and semantics MUST NOT
|
||||
+ // change in subsequent versions of the operator set.
|
||||
+ // When a function is published as EXPERIMENTAL, the syntax and semantics
|
||||
+ // of the function MAY change across operator set versions.
|
||||
+ // Functions "become" stable by deprecating the experimental version and
|
||||
+ // introducing a new stable function with the same name.
|
||||
+ optional OperatorStatus status = 3;
|
||||
+
|
||||
+ // The inputs and outputs of the function.
|
||||
+ repeated string input = 4;
|
||||
+ repeated string output = 5;
|
||||
+
|
||||
+ // The attributes of the function.
|
||||
+ repeated string attribute= 6;
|
||||
+
|
||||
+ // The nodes in the function.
|
||||
+ repeated NodeProto node = 7;
|
||||
+ // A human-readable documentation for this function. Markdown is allowed.
|
||||
+ optional string doc_string = 8;
|
||||
+
|
||||
+ // The OperatorSets this function body (graph) relies on.
|
||||
+ // A FunctionProto body (graph) may implicitly rely on the OperatorSet that
|
||||
+ // this function belongs to. It can also explicitly rely on more OperatorSets
|
||||
+ // with this field specified.
|
||||
+ //
|
||||
+ // All nodes in the function body (graph) will bind against the operator
|
||||
+ // with the same-domain/same-op_type operator with the HIGHEST version
|
||||
+ // in the referenced operator sets. This means at most one version can be relied
|
||||
+ // for one domain.
|
||||
+ repeated OperatorSetIdProto opset_import = 9;
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
Reference in New Issue
Block a user