class_docstr: Stochastic version of basic next-frame model.
docstr: Inject a VAE-style latent.
docstr_tok: ["Inject","a","VAE-style","latent","."]
code: def inject_latent(self, layer, inputs, target, action):
      """Inject a VAE-style latent."""
      del action
      # Latent for stochastic model
      filters = 128
      full_video = tf.stack(inputs + [target], axis=1)
      latent_mean, latent_std = self.construct_latent_tower(
          full_video, time_axis=1
      )
      latent = common_video.get_gaussian_tensor(latent_mean, latent_std)
      latent = tfl.flatten(latent)
      latent = tf.expand_dims(latent, axis=1)
      latent = tf.expand_dims(latent, axis=1)
      latent_mask = tfl.dense(latent, filters, name="latent_mask")
      zeros_mask = tf.zeros(
          common_layers.shape_list(layer)[:-1] + [filters],
          dtype=tf.float32,
      )
      layer = tf.concat([layer, latent_mask + zeros_mask], axis=-1)
      extra_loss = self.get_kl_loss([latent_mean], [latent_std])
      return layer, extra_loss
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.layers import discretization
  from tensor2tensor.models.video import base_vae
  from tensor2tensor.models.video import basic_deterministic
  from tensor2tensor.models.video import basic_deterministic_params
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the NextFrameBasicStochastic obj's underlying member method code with example usage: obj.inject_latent(layer, inputs, target, action) and returns: layer,  extra_loss