diff --git a/torch_ipex/csrc/cpu/embeddingbag.cpp b/torch_ipex/csrc/cpu/embeddingbag.cpp index a2156ee70..5c048ad50 100644 --- a/torch_ipex/csrc/cpu/embeddingbag.cpp +++ b/torch_ipex/csrc/cpu/embeddingbag.cpp @@ -494,9 +494,13 @@ at::Tensor AtenIpexJITDev::dil_qembeddingbag( } // namespace torch_ipex namespace { -static auto dispatch = - torch::RegisterOperators() - .op("torch_ipex::embedding_bag", &torch_ipex::AtenIpexTypeExt::embedding_bag); +TORCH_LIBRARY_FRAGMENT(torch_ipex, m) { + m.def(torch::schema( + "torch_ipex::embedding_bag(Tensor weight, Tensor indices, Tensor " + "offsets, bool sparse, bool include_last_offset) -> Tensor", + c10::AliasAnalysisKind::PURE_FUNCTION), + torch_ipex::AtenIpexTypeExt::embedding_bag); +} } namespace torch_ipex { diff --git a/torch_ipex/csrc/cpu/interaction.cpp b/torch_ipex/csrc/cpu/interaction.cpp index ff7a0efe7..68a3bb5d8 100644 --- a/torch_ipex/csrc/cpu/interaction.cpp +++ b/torch_ipex/csrc/cpu/interaction.cpp @@ -422,12 +422,16 @@ at::Tensor AtenIpexJITDev::dil_qinteraction(const std::vector input, } // namespace torch_ipex namespace { -static auto dispatch = - torch::RegisterOperators() - .op("torch_ipex::interaction_forward", - &torch_ipex::AtenIpexTypeExt::interaction_forward) - .op("torch_ipex::interaction_backward", - &torch_ipex::AtenIpexTypeExt::interaction_backward); +TORCH_LIBRARY_FRAGMENT(torch_ipex, m) { + m.def( + torch::schema("torch_ipex::interaction_forward(Tensor[] input) -> Tensor", + c10::AliasAnalysisKind::PURE_FUNCTION), + torch_ipex::AtenIpexTypeExt::interaction_forward); + m.def(torch::schema("torch_ipex::interaction_backward(Tensor grad_out, " + "Tensor[] input) -> Tensor[]", + c10::AliasAnalysisKind::PURE_FUNCTION), + torch_ipex::AtenIpexTypeExt::interaction_backward); +} } namespace torch_ipex {