Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent a460236 commit 7d0a9bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions thunder/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,9 +1211,11 @@ def relu6(a: TensorProxy, /, inplace: bool = False) -> TensorLike:
@torchsymbol(torch.nn.functional.hardswish, id="torch.hardswish", is_method=False)
def hardswish(a: TensorProxy, /, inplace: bool = False) -> TensorLike:
utils.check(not inplace, lambda: f"hardswish only supports inplace=False", exception_type=NotImplementedError)
utils.check(dtypes.is_float_dtype(a.dtype),
lambda: f"hardswish only supports floating point dtypes, got {a.dtype}",
exception_type=ValueError)
utils.check(
dtypes.is_float_dtype(a.dtype),
lambda: f"hardswish only supports floating point dtypes, got {a.dtype}",
exception_type=ValueError,
)
return a * relu6(a + 3) / 6


Expand Down

0 comments on commit 7d0a9bb

Please sign in to comment.