class_docstr: 2D Image to Patch Embedding
class_docstr_tok: ["2D","Image","to","Patch","Embedding"]
code: def forward(self, latent):
      latent = self.proj(latent)
      if self.flatten:
          latent = latent.flatten(2).transpose(1, 2)  # BCHW -> BNC
      if self.layer_norm:
          latent = self.norm(latent)
      if self.use_pos_embed:
          return latent + self.pos_embed
      else:
          return latent
  
imports: import math
  from typing import Optional, Union
  import torch
  from torch import nn
  from ...configuration_utils import ConfigMixin, register_to_config
  from ...models import ModelMixin
  from ...models.attention import AdaLayerNorm, FeedForward
  from ...models.attention_processor import Attention
  from ...models.embeddings import TimestepEmbedding, Timesteps, get_2d_sincos_pos_embed
  from ...models.transformer_2d import Transformer2DModelOutput
  from ...utils import logging
label_desc: Use image node_id 2 for calling the PatchEmbed obj's underlying member method code with example usage: obj.forward(latent) and returns: unknown, latent