Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/requirements/ci/onnx-weekly-1…
Browse files Browse the repository at this point in the history
….16.0.dev20231211
  • Loading branch information
justinchuby authored Dec 12, 2023
2 parents 4875b63 + 9edefbb commit e20ac9f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: "3.10"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install nox
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
Expand All @@ -121,7 +121,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
- name: Update readme
run: |
python docs/update_readme.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions onnxscript/function_libs/torch_lib/ops/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,11 @@ def aten_glu_jvp(glu: TensorType, x: TensorType, dx: TensorType, dim: int) -> Te
raise NotImplementedError()


def aten_hardsigmoid(self: TensorType) -> TensorType:
@torch_op("aten::hardsigmoid")
def aten_hardsigmoid(self: TFloat) -> TFloat:
"""hardsigmoid(Tensor self) -> Tensor"""

raise NotImplementedError()
return op.HardSigmoid(self, alpha=1 / 6, beta=1 / 2)


def aten_hardsigmoid_backward(grad_output: TensorType, self: TensorType) -> TensorType:
Expand All @@ -608,10 +609,11 @@ def aten_hardsigmoid_backward(grad_output: TensorType, self: TensorType) -> Tens
raise NotImplementedError()


def aten_hardswish(self: TensorType) -> TensorType:
@torch_op("aten::hardswish")
def aten_hardswish(self: TFloat) -> TFloat:
"""hardswish(Tensor self) -> Tensor"""

raise NotImplementedError()
return op.HardSwish(self)


def aten_hardswish_backward(grad_output: TensorType, self: TensorType) -> TensorType:
Expand Down
2 changes: 2 additions & 0 deletions onnxscript/tests/function_libs/torch_lib/ops_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,8 @@ def _where_input_wrangler(
core_ops.aten_embedding,
input_wrangler=_embedding_input_wrangler,
),
TorchLibOpInfo("nn.functional.hardsigmoid", nn_ops.aten_hardsigmoid),
TorchLibOpInfo("nn.functional.hardswish", nn_ops.aten_hardswish),
TorchLibOpInfo("nn.functional.hardtanh", nn_ops.aten_hardtanh),
TorchLibOpInfo("nn.functional.leaky_relu", nn_ops.aten_leaky_relu),
TorchLibOpInfo(
Expand Down

0 comments on commit e20ac9f

Please sign in to comment.