Which PyTorch version are you using?
This dummy code snippet works in the latest stable release:
cpp_source = """
    torch::Tensor my_norm(torch::Tensor input){
    
      auto out = torch::nn::functional::normalize(input);
      return out;
    }
    
"""

module = torch.utils.cpp_extension.load_inline(
    name="my_norm",
    cpp_sources=cpp_source,
    functions="my_norm",
    verbose=True,
)

x = torch.randn(10, 10)
out = module.my_norm(x)