Good advice @8bitmp3.
That lambda x: (x, x) thing is common for autoencoders in tensorflow/keras. Model.fit expects (input, target) pairs. When you’re writing an auto-encoder, the target is the input. For many styles of autoencoder the target is a slightly modified version of the input.

 negloglik = lambda x, rv_x: -rv_x.log_prob(x)
AttributeError: 'Tensor' object has no attribute 'log_prob'


Right, so in keras a loss function takes the label and output as arguments, and returns the loss value.
In the tutorial the final layer of the decoder is a: tfpl.IndependentBernoulli(input_shape, tfd.Bernoulli.logits), which returns some sort of tfp probability distribution when called.
tfp probability distributions have a .log_prob(x) method.
In your code, the last layer of the decoder is a layers.Dense(input_dimensions) that just returns a Tensor, which doesn’t have a .log_prob method.