Thanks AlphaBetaGamma96. I’ve find a solution which I can continue to train it when using torch1.8.1+cu111. The following is my solution after declaring these 2 variables to access the Constraint().
class TanhBijector(torch.distributions.Transform):
    def __init__(self):
        super().__init__()
        self.bijective = True
        self.domain = torch.distributions.constraints.Constraint()
        self.codomain = torch.distributions.constraints.Constraint()