code: def forward(self, x, output_layer_levels: List[int] = None):
      output = ModelOutput()
  
      max_depth = self.depth
  
      if output_layer_levels is not None:
          assert all(
              self.depth >= levels > 0 or levels == -1
              for levels in output_layer_levels
          ), f"Cannot output layer deeper than depth ({self.depth}). Got ({output_layer_levels})."
  
          if -1 in output_layer_levels:
              max_depth = self.depth
          else:
              max_depth = max(output_layer_levels)
  
      out = x.reshape(-1, np.prod(self.input_dim))
  
      for i in range(max_depth):
          out = self.layers[i](out)
  
          if output_layer_levels is not None:
              if i + 1 in output_layer_levels:
                  output[f"embedding_layer_{i+1}"] = out
          if i + 1 == self.depth:
              output["embedding"] = self.embedding(out)
              output["log_concentration"] = self.log_concentration(out)
  
      return output
  
imports: import logging
  import os
  from typing import List
  import numpy
  import torch
  import torch.nn
  from torch.utils.data import Dataset
  from pythae.data.datasets import DatasetOutput
  from pythae.models import SVAE, AutoModel, SVAEConfig
  from pythae.models.base.base_utils import ModelOutput
  from pythae.models.nn import BaseDecoder, BaseEncoder
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
label_desc: Use image node_id 2 for calling the Encoder obj's underlying member method code with example usage: obj.forward(x, output_layer_levels) and returns: output