class_docstr: Temporal Entropy Model
class_docstr_tok: ["Temporal","Entropy","Model"]
docstr: Process previous quantized latent by passing it through the encoder.
  
  This can be used if previous latents go through expensive transforms
  before being fed to the entropy model, and will be stored in the `processed`
  field of the `PreviousLatent` tuple.
  
  The output of this function applied to all quantized latents should
  be fed to the `forward` method. This is used to improve efficiency,
  as it avoids calling expensive processing of previous latents at
  each time step.
  
  Args:
      previous_latent_quantized: previous quantized latent that is to be processed,
          expected shape [B, C, H, W]
  
  Returns:
      PreviousLatent object with the processed latent in the processed field
docstr_tok: ["Process","previous","quantized","latent","by","passing","it","through","the","encoder",".","This","can","be","used","if","previous","latents","go","through","expensive","transforms","before","being","fed","to","the","entropy","model",",","and","will","be","stored","in","the","`","processed","`","field","of","the","`","PreviousLatent","`","tuple",".","The","output","of","this","function","applied","to","all","quantized","latents","should","be","fed","to","the","`","forward","`","method",".","This","is","used","to","improve","efficiency",",","as","it","avoids","calling","expensive","processing","of","previous","latents","at","each","time","step",".","Args",":","previous_latent_quantized",":","previous","quantized","latent","that","is","to","be","processed",",","expected","shape","[","B",",","C",",","H",",","W","]","Returns",":","PreviousLatent","object","with","the","processed","latent","in","the","processed","field"]
code: def process_previous_latent_q(
      self, previous_latent_quantized: Tensor
  ) -> PreviousLatent:
      """Process previous quantized latent by passing it through the encoder.
  
      This can be used if previous latents go through expensive transforms
      before being fed to the entropy model, and will be stored in the `processed`
      field of the `PreviousLatent` tuple.
  
      The output of this function applied to all quantized latents should
      be fed to the `forward` method. This is used to improve efficiency,
      as it avoids calling expensive processing of previous latents at
      each time step.
  
      Args:
          previous_latent_quantized: previous quantized latent that is to be processed,
              expected shape [B, C, H, W]
  
      Returns:
          PreviousLatent object with the processed latent in the processed field
      """
      patches, _ = self.patcher(
          previous_latent_quantized, self.window_size_enc
      )  # [b', seq_len, C], seq_len = patch_size^2, C=num_channels
  
      patches = patches / _LATENT_NORM_FAC
      patches = self.encoder_embedding(
          patches
      )  # [b', seq_len, d_model]
      patches = self.post_embedding_layernorm(
          patches
      )  # [b', seq_len, d_model]
      patches = self.enc_position_sep(patches)  # [b', seq_len, d_model]
      patches = self.encoder_sep(patches)  # [b', seq_len, d_model]
  
      return PreviousLatent(
          previous_latent_quantized, processed=patches
      )
  
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 3 for calling the VCTEntropyModel obj's underlying member method code with example usage: obj.process_previous_latent_q(previous_latent_quantized) and returns: PreviousLatent