Hi,
If you use a function that only use pytorch Tensors and pytorch functions, No need for a new layer. You can use the following in your forward pass (make changes for batch-size if you need):
def to_polar(x, y):
  return (x**2 + y**2).sqrt(), torch.atan(y/x)