Skip to content

Commit

Permalink
feat: add shape inference support for Sign operator
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelspark committed Mar 26, 2023
1 parent babc77e commit 90fc8ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ fn test_matmul_square_matrix() {
|<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>|||
|<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>|
|<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>||
|<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>|
|<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>|||
|<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>|||
|<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>|||
|<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>|||
Expand Down
4 changes: 2 additions & 2 deletions wonnx-preprocessing/src/shape_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ pub(crate) fn infer_output_shapes(
| (
"Identity" | "Sqrt" | "Relu" | "LeakyRelu" | "Abs" | "Acos" | "Acosh" | "Asin" | "Sin"
| "Asinh" | "Atan" | "Atanh" | "Cos" | "Cosh" | "Elu" | "Erf" | "Exp" | "Log" | "Neg"
| "Ceil" | "Floor" | "Reciprocal" | "Celu",
| "Ceil" | "Floor" | "Reciprocal" | "Celu" | "Sign",
1,
1,
) => Ok(vec![input_shapes[0].clone()]),
Expand Down Expand Up @@ -1210,7 +1210,7 @@ pub(crate) fn infer_output_shapes(
| "Atan" | "Atanh" | "Cos" | "Cosh" | "Elu" | "Erf" | "Exp" | "Log" | "Neg" | "Ceil"
| "Reciprocal" | "Floor" | "Mod" | "Celu" | "ReduceSum" | "ReduceMin" | "ReduceMax"
| "ReduceSumSquare" | "ReduceLogSumExp" | "ReduceLogSum" | "ReduceL2" | "ReduceL1"
| "ReduceProd" | "Size",
| "ReduceProd" | "Size" | "Sign",
_,
_,
) => Err(ShapeInferenceError::InvalidNode(
Expand Down

0 comments on commit 90fc8ba

Please sign in to comment.