class_docstr: Temporal Entropy Model
class_docstr_tok: ["Temporal","Entropy","Model"]
docstr: Predict the distribution of the current quantized patched latent
  
  Args:
      encoded_patched: tensor of shape [*b, context_len*patch_enc^2, d_model],
          where with the defaults (patch_enc=8, d_model=768), so we have
          default expected shape [*b, 128, 768]
      latent_q_patched: tensor of shape [*b, patch_dec^2, num_channels], where
          with the default patch_dec^2=16 and num_channels = 192, so we have
          default expected shape [*b, 16, 192]
  
  Returns:
      a tuple containing 3 tensors: mean, scale and decoder output
docstr_tok: ["Predict","the","distribution","of","the","current","quantized","patched","latent","Args",":","encoded_patched",":","tensor","of","shape","[","*","b",",","context_len","*","patch_enc^2",",","d_model","]",",","where","with","the","defaults","(","patch_enc=8",",","d_model=768",")",",","so","we","have","default","expected","shape","[","*","b",",","128",",","768","]","latent_q_patched",":","tensor","of","shape","[","*","b",",","patch_dec^2",",","num_channels","]",",","where","with","the","default","patch_dec^2=16","and","num_channels","=","192",",","so","we","have","default","expected","shape","[","*","b",",","16",",","192","]","Returns",":","a","tuple","containing","3","tensors",":","mean",",","scale","and","decoder","output"]
code: def _get_transformer_output(
      self, *, encoded_patched: Tensor, latent_q_patched: Tensor
  ) -> Tuple[Tensor, Tensor, Tensor]:
      """Predict the distribution of the current quantized patched latent
  
      Args:
          encoded_patched: tensor of shape [*b, context_len*patch_enc^2, d_model],
              where with the defaults (patch_enc=8, d_model=768), so we have
              default expected shape [*b, 128, 768]
          latent_q_patched: tensor of shape [*b, patch_dec^2, num_channels], where
              with the default patch_dec^2=16 and num_channels = 192, so we have
              default expected shape [*b, 16, 192]
  
      Returns:
          a tuple containing 3 tensors: mean, scale and decoder output
      """
      if encoded_patched.shape[-1] != self.d_model:
          raise ValueError(
              f"Context must have final dim {self.d_model}, "
              f"got shape={encoded_patched.shape}. "
              "Did you run `process_previous_latent_q`?"
          )
      latent_q_patched_shifted = self.learned_zero(latent_q_patched)
      del latent_q_patched  # should not be used after this line
  
      latent_q_patched_emb_shifted = self._embed_latent_q_patched(
          latent_q_patched_shifted
      )  # [B', seq_length_enc, d_model]
  
      encoded_patched = self.enc_position_joint(encoded_patched)
      encoded_patched = self.encoder_joint(
          encoded_patched
      )  # [B', seq_len, d_model]
  
      # RUN DECODER
      dec_output = self.decoder(
          input=latent_q_patched_emb_shifted,
          encoder_output=encoded_patched,
      )  # [B', seq_length_dec, hidden_dim]
  
      mean = self.mean_head(
          dec_output
      )  # [B', seq_length_dec, hidden_dim]
      scale = self.scale_head(
          dec_output
      )  # [B', seq_length_dec, hidden_dim]
  
      return mean, scale, dec_output
  
imports: import itertools
  import sys
  from typing import Dict, List, NamedTuple, Optional, Sequence, Tuple
  import torch
  import torch.nn
  from torch import Tensor
  from .bottlenecks import GsnConditionalLocScaleShift
  from .entropy_model_layers import EncoderSection, LearnedPosition, StartSym, Transformer
  from .layers_utils import make_embedding
  from .patcher import Patcher
label_desc: Use image node_id 5 for calling the VCTEntropyModel obj's underlying member method code with example usage: obj._get_transformer_output() and returns: mean,  scale,  dec_output