class_docstr: Glue together encoder transform, entropy model and decoder transform
docstr: Args:
      scenes: Scenes object, containing `tensor` of shape [B, T, C, H, W]
      cache: Cache object
docstr_tok: ["Args",":","scenes",":","Scenes","object",",","containing","`","tensor","`","of","shape","[","B",",","T",",","C",",","H",",","W","]","cache",":","Cache","object"]
code: def encode_scenes(
      self, scenes: Scenes, cache: memoize.Cache
  ) -> Generator[Bottleneck, None, None]:
      """
      Args:
          scenes: Scenes object, containing `tensor` of shape [B, T, C, H, W]
          cache: Cache object
      """
      state = None
      for index, scene in enumerate(scenes.get_scenes_iter()):
          if index == 0:
              state, encode_out = self.encode_Iscene(scene, cache=cache)
          else:
              assert state is not None
              state, encode_out = self.encode_Pscene(
                  scene, index, state, cache=cache
              )
          yield encode_out
  
imports: import itertools
  import math
  from typing import Generator, List, NamedTuple, Optional, Sequence, Tuple, Union
  import torch
  import torch.nn
  import utils.memoize
  from datamodules.video_data_api import Scenes, VideoData
  from neural.entropy_model import PreviousLatent, VCTEntropyModel
  from torch import Tensor
label_desc: Use image node_id 4 for calling the VCTPipeline obj's underlying member method code with example usage: obj.encode_scenes(scenes, cache) without return types