def get_all_frames(self, input_frames, target_frames):
    """Get the frames used as input to the model.

    Args:
      input_frames: 5-D Tensor, (NTHWC)
      target_frames: 5-D Tensor, (NTHWC)
    Returns:
      frames: 5-D Tensor used as input to the model.
    """
    if self.is_predicting:
      all_frames = input_frames
    elif self.is_training:
      all_frames = tf.concat((input_frames, target_frames), axis=1)
      all_frames = common_video.extract_random_video_patch(
          all_frames, self.hparams.num_train_frames)
    # Measure the mean bit-per-pixel of the target_frames during eval.
    else:
      all_frames = tf.concat((input_frames, target_frames), axis=1)
    if self.hparams.cond_first_frame:
      first_frame = all_frames[:, 0:1, :, :, :]
      all_frames = tf.concat((first_frame, all_frames), axis=1)
    return all_frames
Get the frames used as input to the model.

    Args:
      input_frames: 5-D Tensor, (NTHWC)
      target_frames: 5-D Tensor, (NTHWC)
    Returns:
      frames: 5-D Tensor used as input to the model.
    
tensor2tensor/models/video/next_frame_glow.py