I don’t know what a functor is in TF/Keras, but would assume that you could just create the nn.Conv2d layer in PyTorch and pass the input directly to it.
If that’s not the case, could you explain what this code is doing?