docstr: Encode images into latent representations.
  
  Parameters:
      imgs (torch.Tensor): Image tensor [B, 3, H, W].
  
  Returns:
      torch.Tensor: Encoded latent tensor.
docstr_tok: ["Encode","images","into","latent","representations",".","Parameters",":","imgs","(","torch.Tensor",")",":","Image","tensor","[","B",",","3",",","H",",","W","]",".","Returns",":","torch.Tensor",":","Encoded","latent","tensor","."]
code: def encode_imgs(self, imgs: torch.Tensor) -> torch.Tensor:
      """
      Encode images into latent representations.
  
      Parameters:
          imgs (torch.Tensor): Image tensor [B, 3, H, W].
  
      Returns:
          torch.Tensor: Encoded latent tensor.
      """
      imgs = 2 * imgs - 1
      posterior = self.vae.encode(imgs).latent_dist
      latents = posterior.sample() * self.vae.config.scaling_factor
      return latents
  
file_path: NeMo/nemo/collections/multimodal/modules/nerf/guidance/stablediffusion_huggingface_pipeline.py
imports: from typing import List
  import torch
  import torch.nn.functional
  from diffusers import DDIMScheduler, StableDiffusionPipeline
  from nemo.collections.multimodal.modules.nerf.guidance.txt2img_guidance_base import Txt2ImgGuidanceBase
label_desc: Use image node_id 5 for calling the StableDiffusion obj's underlying member method code with example usage: obj.encode_imgs(imgs) and returns: latents