class_docstr: From https://github.com/toshas/torch-fidelity/blob/master/examples/sngan_cifar10.py.
class_docstr_tok: ["From","https",":","\/\/github.com\/toshas\/torch-fidelity\/blob\/master\/examples\/sngan_cifar10.py","."]
docstr: Generate images from latent vectors.
docstr_tok: ["Generate","images","from","latent","vectors","."]
code: def forward(self, z):
      """Generate images from latent vectors."""
      fake = self.model(z.view(-1, self.z_size, 1, 1))
      if not self.training:
          fake = 255 * (fake.clamp(-1, 1) * 0.5 + 0.5)
          fake = fake.to(torch.uint8)
      return fake
  
imports: from operator import attrgetter
  import pytest
  import torch
  import torch_fidelity
  from torch import nn
  from torch_fidelity.sample_similarity_lpips import SampleSimilarityLPIPS
  from torch_fidelity.utils import batch_interp
  from torchmetrics.functional.image.lpips import _LPIPS
  from torchmetrics.functional.image.perceptual_path_length import _interpolate, perceptual_path_length
  from torchmetrics.image.perceptual_path_length import PerceptualPathLength
  from torchmetrics.utilities.imports import _TORCH_FIDELITY_AVAILABLE
  from unittests import skip_on_running_out_of_memory
  from unittests.helpers import seed_all
label_desc: Use image node_id 2 for calling the DummyGenerator obj's underlying member method code with example usage: obj.forward(z) and returns: fake