Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 90fc8ba

Browse files
committed
feat: add shape inference support for Sign operator
1 parent babc77e commit 90fc8ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ fn test_matmul_square_matrix() {
342342
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Shape">Shape</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Shape-15">15</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Shape-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Shape-1">1</a>|||
343343
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Shrink">Shrink</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Shrink-9">9</a>|
344344
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sigmoid">Sigmoid</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sigmoid-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sigmoid-6">6</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sigmoid-1">1</a>||
345-
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sign">Sign</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sign-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sign-9">9</a>|
345+
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sign">Sign</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sign-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sign-9">9</a>|||
346346
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sin">Sin</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sin-7">7</a>|||
347347
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sinh">Sinh</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sinh-9">9</a>|||
348348
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Size">Size</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Size-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Size-1">1</a>|||

wonnx-preprocessing/src/shape_inference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ pub(crate) fn infer_output_shapes(
484484
| (
485485
"Identity" | "Sqrt" | "Relu" | "LeakyRelu" | "Abs" | "Acos" | "Acosh" | "Asin" | "Sin"
486486
| "Asinh" | "Atan" | "Atanh" | "Cos" | "Cosh" | "Elu" | "Erf" | "Exp" | "Log" | "Neg"
487-
| "Ceil" | "Floor" | "Reciprocal" | "Celu",
487+
| "Ceil" | "Floor" | "Reciprocal" | "Celu" | "Sign",
488488
1,
489489
1,
490490
) => Ok(vec![input_shapes[0].clone()]),
@@ -1210,7 +1210,7 @@ pub(crate) fn infer_output_shapes(
12101210
| "Atan" | "Atanh" | "Cos" | "Cosh" | "Elu" | "Erf" | "Exp" | "Log" | "Neg" | "Ceil"
12111211
| "Reciprocal" | "Floor" | "Mod" | "Celu" | "ReduceSum" | "ReduceMin" | "ReduceMax"
12121212
| "ReduceSumSquare" | "ReduceLogSumExp" | "ReduceLogSum" | "ReduceL2" | "ReduceL1"
1213-
| "ReduceProd" | "Size",
1213+
| "ReduceProd" | "Size" | "Sign",
12141214
_,
12151215
_,
12161216
) => Err(ShapeInferenceError::InvalidNode(

0 commit comments

Comments
 (0)