1from model import get_custom_op_library_path 2 3import torch 4 5 6torch.ops.load_library(get_custom_op_library_path()) 7 8 9# NB: The impl_abstract_pystub for cos actually 10# specifies it should live in the my_custom_ops2 module. 11@torch.library.impl_abstract("custom::cos") 12def cos_abstract(x): 13 return torch.empty_like(x) 14 15 16# NB: There is no impl_abstract_pystub for tan 17@torch.library.impl_abstract("custom::tan") 18def tan_abstract(x): 19 return torch.empty_like(x) 20