Distribution Error: The value argument must be within the support

So, I found this cool Normalizing flow tutorial in PyTorch and I was trying the first tut itself link here

import torch.distributions as distrib
import torch.distributions.transforms as transforms


x = np.linspace(-4, 4, 1000)
z = np.array(np.meshgrid(x, x)).transpose(1, 2, 0)
z = np.reshape(z, [z.shape[0] * z.shape[1], -1])

And the transformations like

# Initial distribution
q0 = distrib.MultivariateNormal(torch.zeros(2), torch.eye(2))
# Defining Affine Transformation
f1 = transforms.ExpTransform()
# Transforming
q1 = distrib.TransformedDistribution(q0, f1)

---> q1.log_prob(torch.Tensor(z))

The last line raises ValueError: The value argument must be within the support which is not the case in the notebook did something change? Because I tried running the whole notebook on colab and it broke there too and on my system too.
Any help what might be wrong?

1 Like

Any workaround for this?