-
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.
fix: Add torch.utils.dlpack frontend
- Loading branch information
1 parent
8183a22
commit 9412c70
Showing
4 changed files
with
18 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .dlpack 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,15 @@ | ||
# local | ||
import ivy | ||
from ivy.functional.frontends.torch.func_wrapper import ( | ||
to_ivy_arrays_and_back, | ||
) | ||
|
||
|
||
@to_ivy_arrays_and_back | ||
def from_dlpack(ext_tensor): | ||
return ivy.from_dlpack(ext_tensor) | ||
|
||
|
||
@to_ivy_arrays_and_back | ||
def to_dlpack(ext_tensor): | ||
return ivy.to_dlpack(ext_tensor) |