mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
The `usort` config in `pyproject.toml` has no effect due to a typo. Fixing the typo make `usort` do more and generate the changes in the PR. Except `pyproject.toml`, all changes are generated by `lintrunner -a --take UFMT --all-files`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127126 Approved by: https://github.com/kit1980
19 lines
461 B
Python
19 lines
461 B
Python
from model import get_custom_op_library_path
|
|
|
|
import torch
|
|
|
|
torch.ops.load_library(get_custom_op_library_path())
|
|
|
|
|
|
# NB: The impl_abstract_pystub for cos actually
|
|
# specifies it should live in the my_custom_ops2 module.
|
|
@torch.library.impl_abstract("custom::cos")
|
|
def cos_abstract(x):
|
|
return torch.empty_like(x)
|
|
|
|
|
|
# NB: There is no impl_abstract_pystub for tan
|
|
@torch.library.impl_abstract("custom::tan")
|
|
def tan_abstract(x):
|
|
return torch.empty_like(x)
|