Skip to content

Commit 627c8f2

Browse files
authored
Merge 5daa772 into a8e4648
2 parents a8e4648 + 5daa772 commit 627c8f2

12 files changed

Lines changed: 3150 additions & 893 deletions

File tree

docs/Changelog.md

Lines changed: 1365 additions & 0 deletions
Large diffs are not rendered by default.

docs/Operators.md

Lines changed: 112 additions & 56 deletions
Large diffs are not rendered by default.

onnx/cpp2py_export.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ PYBIND11_MODULE(onnx_cpp2py_export, onnx_cpp2py_export) {
4141
"type_constraints", &OpSchema::typeConstraintParams)
4242
.def_static(
4343
"is_infinite",
44-
[](int v) { return v == std::numeric_limits<int>::max(); })
45-
.def("consumed", [](const OpSchema& schema, int i) {
46-
return schema.consumed(i);
47-
});
44+
[](int v) { return v == std::numeric_limits<int>::max(); });
4845

4946
py::class_<OpSchema::Attribute>(op_schema, "Attribute")
5047
.def_readonly("name", &OpSchema::Attribute::name)
@@ -90,11 +87,6 @@ PYBIND11_MODULE(onnx_cpp2py_export, onnx_cpp2py_export) {
9087
.value("COMMON", OpSchema::SupportType::COMMON)
9188
.value("EXPERIMENTAL", OpSchema::SupportType::EXPERIMENTAL);
9289

93-
py::enum_<OpSchema::UseType>(op_schema, "UseType")
94-
.value("DEFAULT", OpSchema::UseType::DEFAULT)
95-
.value("CONSUME_ALLOWED", OpSchema::UseType::CONSUME_ALLOWED)
96-
.value("CONSUME_ENFORCED", OpSchema::UseType::CONSUME_ENFORCED);
97-
9890
defs.def("has_schema", [](const std::string& op_type) -> bool {
9991
return OpSchemaRegistry::Schema(op_type) != nullptr;
10092
});

onnx/defs/experiments/defs.cc

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ is applied to the tensor elementwise.
3535

3636
ONNX_OPERATOR_SCHEMA(ThresholdedRelu)
3737
.SetSupportLevel(SupportType::EXPERIMENTAL)
38-
.AllowConsumed({{0, 0}})
3938
.SetDoc(R"DOC(
4039
ThresholdedRelu takes one input data (Tensor<T>) and produces one output data
4140
(Tensor<T>) where the rectified linear function, y = x for x > alpha, y = 0 otherwise,
@@ -52,7 +51,6 @@ is applied to the tensor elementwise.
5251

5352
ONNX_OPERATOR_SCHEMA(ScaledTanh)
5453
.SetSupportLevel(SupportType::EXPERIMENTAL)
55-
.AllowConsumed({{0, 0}})
5654
.SetDoc(R"DOC(
5755
Calculates the scaled hyperbolic tangent of the given input tensor element-wise,
5856
alpha * tanh(beta * x). This operation can be done in an in-place fashion too,
@@ -68,7 +66,6 @@ by providing the same input and output blobs.
6866

6967
ONNX_OPERATOR_SCHEMA(ParametricSoftplus)
7068
.SetSupportLevel(SupportType::EXPERIMENTAL)
71-
.AllowConsumed({{0, 0}})
7269
.SetDoc(R"DOC(
7370
ParametricSoftplus takes one input data (Tensor<T>) and produces one output data
7471
(Tensor<T>) where the softplus function, y = alpha * ln(exp(beta * x) + 1), is applied to
@@ -83,7 +80,6 @@ the tensor elementwise.
8380

8481
ONNX_OPERATOR_SCHEMA(ConstantFill)
8582
.SetSupportLevel(SupportType::EXPERIMENTAL)
86-
.AllowConsumed({{0, 0}})
8783
.SetDoc(R"DOC(
8884
The operator fills the elements of the output tensor with a constant value
8985
specified by the 'value' attribute.
@@ -156,18 +152,17 @@ NOTE: Currently, it supports data type of float, int32, int64, and bool.
156152
"Constrain output types to float, int32, int64, bool tensors.");
157153

158154
ONNX_OPERATOR_SCHEMA(GivenTensorFill)
159-
.SetSupportLevel(SupportType::EXPERIMENTAL)
160-
.Input(0, "shape", "The shape of filled tensor", "T", OpSchema::Optional)
161-
.Output(0, "X", "The filled tensor", "T")
162-
.TypeConstraint(
163-
"T",
164-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
165-
"Constrain input and output types to float tensors.")
155+
.SetSupportLevel(SupportType::EXPERIMENTAL)
156+
.Input(0, "shape", "The shape of filled tensor", "T", OpSchema::Optional)
157+
.Output(0, "X", "The filled tensor", "T")
158+
.TypeConstraint(
159+
"T",
160+
{ "tensor(float16)", "tensor(float)", "tensor(double)" },
161+
"Constrain input and output types to float tensors.")
166162
.Attr("values", "", AttributeProto::FLOATS, OPTIONAL)
167163
.Attr("shape", "", AttributeProto::INTS, OPTIONAL)
168164
.Attr("input_as_shape", "", AttributeProto::INT, OPTIONAL)
169-
.Attr("extra_shape", "", AttributeProto::INTS, OPTIONAL)
170-
.AllowConsumed({{0, 0}});
165+
.Attr("extra_shape", "", AttributeProto::INTS, OPTIONAL);
171166

172167
ONNX_OPERATOR_SCHEMA(FC)
173168
.SetSupportLevel(SupportType::EXPERIMENTAL)
@@ -231,7 +226,6 @@ ONNX_OPERATOR_SCHEMA(Scale)
231226
"T",
232227
{"tensor(float16)", "tensor(float)", "tensor(double)"},
233228
"Constrain input and output types to float tensors.")
234-
.AllowConsumed({{0, 0}})
235229
.SetDoc(R"DOC(
236230
Scale takes one input data (Tensor<float>) and produces one output data
237231
(Tensor<float>) whose value is the input data tensor scaled element-wise.
@@ -290,7 +284,6 @@ and op)DOC")
290284

291285
ONNX_OPERATOR_SCHEMA(ImageScaler)
292286
.SetSupportLevel(SupportType::EXPERIMENTAL)
293-
.AllowConsumed({{0, 0}})
294287
.SetDoc(R"DOC(Scale and bias the input image. Bias values are stored in
295288
the same ordering as the image pixel format.)DOC")
296289
.Attr("bias", "Bias applied to each channel, same size as C.", AttributeProto::FLOATS, OPTIONAL)
@@ -304,7 +297,6 @@ the same ordering as the image pixel format.)DOC")
304297

305298
ONNX_OPERATOR_SCHEMA(MeanVarianceNormalization)
306299
.SetSupportLevel(SupportType::EXPERIMENTAL)
307-
.AllowConsumed({{0, 0}})
308300
.SetDoc(R"DOC(Perform mean variance normalization.)DOC")
309301
.Attr("across_channels", "If 1, mean and variance are computed across channels. Default is 0.", AttributeProto::INT, static_cast<int64_t>(0))
310302
.Attr("normalize_variance", "If 0, normalize the mean only. Default is 1.", AttributeProto::INT, static_cast<int64_t>(1))
@@ -317,7 +309,6 @@ ONNX_OPERATOR_SCHEMA(MeanVarianceNormalization)
317309

318310
ONNX_OPERATOR_SCHEMA(Crop)
319311
.SetSupportLevel(SupportType::EXPERIMENTAL)
320-
.AllowConsumed({{0, 0}})
321312
.SetDoc(R"DOC(Crop and image to the specified spatial dimensions. If scale is given,
322313
then optionally start the crop offset by the left/top border amounts.
323314
If scale is not provided, crop the borders as provided.)DOC")

0 commit comments

Comments
 (0)