About VAE pyro.sample("obs",...)

I am buliding a VAE model with pyro, the input data is a uniform distribution(0,1).
But I don’t know how to write the parameter in the
dist.Uniform() of the
pyro.sample("obs", dist.Uniform().to_event(1), obs=x) in the def model because it need low and high parameters, I only have one loc_img
Here is my code

 def model(self, x):
        # register PyTorch module `decoder` with Pyro
        pyro.module("decoder", self.decoder)
        with pyro.plate("data", x.shape[0]):
            # setup hyperparameters for prior p(z)
            z_loc = x.new_zeros(torch.Size((x.shape[0], self.z_dim)))
            z_scale = x.new_ones(torch.Size((x.shape[0], self.z_dim)))
            # sample from prior (value will be sampled by guide when computing the ELBO)
            z = pyro.sample("latent", dist.Normal(z_loc, z_scale).to_event(1))
            # decode the latent code z
            loc_img = self.decoder(z)
            # score against actual images
            pyro.sample("obs", dist.Uniform(...,...).to_event(1), obs=x)

it is very unlikely that you want a uniform distribution for your observation distribution. the uniform distribution is parameter-free (apart from the low/high constraints).

standard practice is to use a bernoulli likelihood even though the latter is only strictly defined on the set {0, 1}. nevertheless numerically it can be extended to the interval [0, 1] and this typically gives sensible results. see for example here