Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: isdanni <leedanni@gmail.com>
- Loading branch information
Showing
7 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) ONNX Project Contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import numpy as np | ||
|
||
import onnx | ||
from onnx.backend.test.case.base import Base | ||
from onnx.backend.test.case.node import expect | ||
|
||
|
||
class SiLU(Base): | ||
@staticmethod | ||
def export() -> None: | ||
node = onnx.helper.make_node( | ||
"SiLU", | ||
inputs=["x"], | ||
outputs=["y"], | ||
) | ||
|
||
x = np.array([3, 4, 5]).astype(np.float32) | ||
y = x * 1 / (1 + np.exp(-x)) | ||
expect(node, inputs=[x], outputs=[y], name="test_silu") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1195,6 +1195,9 @@ def test_Sigmoid(self) -> None: | |
|
||
def test_Sign(self) -> None: | ||
self._test_op_upgrade("Sign", 9) | ||
|
||
Check warning Code scanning / lintrunner EDITORCONFIG-CHECKER/editorconfig Warning
Trailing whitespace
Check warning Code scanning / lintrunner RUFF/W293 Warning
Blank line contains whitespace.
See https://docs.astral.sh/ruff/rules/blank-line-with-whitespace |
||
def test_SiLU(self) -> None: | ||
self._test_op_upgrade("SiLU", 21) | ||
|
||
def test_Sinh(self) -> None: | ||
self._test_op_upgrade("Sinh", 9) | ||
|