If your layer is a pure functional method, you could simply define it as a python function via def and call it in your forward method of the model.
On the other hand, if your layer contains parameters or buffers, it might be simpler to create a class deriving from nn.Module (same as your Net definition).