How to implement Laplace Posteriori Approximation on BERT in PyTorch?

Here is the link to SO where I provided code and explained the question:

Please help me if you know how.