-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add torch.special.erfc in torch frontend and turn the implement…
…ation in pointwise ops into an alias for the special func
- Loading branch information
Showing
5 changed files
with
23 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import torch | ||
print(torch.special.erfc(torch.tensor([0, -1., 10.]))) | ||
from ivy.functional.frontends import torch as ivy_torch | ||
print(ivy_torch.special.erfc(ivy_torch.tensor([0, -1., 10.]))) | ||
print(ivy_torch.erfc(ivy_torch.tensor([0, -1., 10.]))) |
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 @@ | ||
from .special_funcs import * |
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,13 @@ | ||
import ivy | ||
from ivy.func_wrapper import ( | ||
with_unsupported_dtypes, | ||
) | ||
from ivy.functional.frontends.torch.func_wrapper import ( | ||
to_ivy_arrays_and_back, | ||
) | ||
|
||
|
||
@with_unsupported_dtypes({"2.2 and below": ("float16", "complex")}, "torch") | ||
@to_ivy_arrays_and_back | ||
def erfc(input, *, out=None): | ||
return 1.0 - ivy.erf(input, out=out) |