 The implementation of PatchConv2d is not equivalent to Conv2d—the implementation Inheriting the nn.Conv2d might be a better choice.