Thank you very much for your reply. Yes, I understand that PyTorch can implement the same simple layer. But the layer I am going to add is a complex layer, which is dynamically changing during the training. So it is really complex to rewrite the whole code by using Pytorch…