title: I am getting error this error : 'Tensor' object has no attribute 'log_prob'
body: <p>I am getting this error </p>
  
  <blockquote>
    <p>AttributeError: 'Tensor' object has no attribute 'log_prob'</p>
  </blockquote>
  
  <p>while implementing Variational autoencoder using Tensorflow Probability.</p>
  
  <pre><code>def dense_layers(sizes):
      return tfk.Sequential([tfkl.Dense(size, activation=tf.nn.leaky_relu) for size in sizes])
  encoder = tfk.Sequential([
      tfkl.InputLayer(input_shape=input_shape, name='encoder_input'),
      dense_layers(intermediary_dims),
      tfkl.Dense(latent_dim, activation = tf.nn.leaky_relu),
      tfkl.Dense(tfpl.MultivariateNormalTriL.params_size(latent_dim), activation=None),
      tfpl.MultivariateNormalTriL(latent_dim,activity_regularizer=tfpl.KLDivergenceRegularizer(prior)),
  ], name='encoder')
  
  encoder.summary()
  plot_model(encoder, to_file='vae_mlp_encoder.png', show_shapes=True)
  
  decoder = tfk.Sequential([
      tfkl.InputLayer(input_shape=[latent_dim]),
      dense_layers(reversed(intermediary_dims)),
      tfkl.Dense(tfpl.IndependentNormal.params_size(original_dim), activation=None),
      tfpl.IndependentNormal(original_dim),
  ], name='decoder')
  
  decoder.summary()
  plot_model(decoder, to_file='vae_mlp_decoder.png', show_shapes=True)
  
  vae = tfk.Model(inputs=encoder.inputs,
                  outputs=decoder(encoder.outputs[0]),
                  name='vae_mlp') # fitting the model 
  
  negloglik = lambda x, rv_x: -rv_x.log_prob(x)
  
  vae.compile(optimizer=tf.keras.optimizers.Nadam(), 
              loss=negloglik)
  
  vae.summary() # summary
  plot_model(vae,
             to_file='vae_mlp.png',
             show_shapes=True) #plotting the model 
  
  #I was expecting the Vae.summary 
  </code></pre>