Just trying to generate the pdf of a unit Gaussian transformed by the Planar Flow with the code below.

But seems like the transformed pdf does not integrate to 1.

Perhaps I am doing something wrong with the way I am computing the transformed pdf.

```
import numpy as np
import torch as torch
import torch.nn as nn
import matplotlib.pylab as plt
import pyro.distributions as dist
import pyro.distributions.transforms as trans
# define a meshgrid
x1 = torch.tensor(data=np.linspace(-5,5,100))
x2 = torch.tensor(data=np.linspace(-5,5,100))
x1_s, x2_s = torch.meshgrid(x1, x2)
x_field = torch.tensor(np.concatenate([x1_s[..., None], x2_s[..., None]], axis=-1)).float()
# base distribution
base_dist = dist.MultivariateNormal(loc=torch.zeros(2), covariance_matrix=torch.eye(2))
# plot base
plt.figure(figsize=(5,5))
plt.contourf(x1_s, x2_s, torch.exp(base_dist.log_prob(x_field)))
# Check if integrates to 1
print(np.trapz(np.trapz(torch.exp(base_dist.log_prob(x_field)), x_field.detach()[:, 0, 0], axis=0), x_field.detach()[0, :, 1]))
# Planar flow
planar_transform = trans.Planar(input_dim=2)
# Setting the params to fixed values
planar_transform.bias = nn.Parameter(data=torch.tensor([0.5]))
planar_transform.u = nn.Parameter(data=torch.tensor([1.0, 1.0]))
planar_transform.w = nn.Parameter(data=torch.tensor([1.0, 1.0]))
# Computing the pdf with jacobian adjustment
y_field = planar_transform(x_field)
planar_pdf = torch.exp(base_dist.log_prob(x_field) - planar_transform.log_abs_det_jacobian(x_field,y_field))
# Checking if the transformed distribution integrates to 1
print(np.trapz(np.trapz(planar_pdf.detach(), y_field.detach()[:, 0, 0], axis=0), y_field.detach()[0, :, 1]))
```