code: def test_alt_diffusion_pndm(self):
      device = "cpu"  # ensure determinism for the device-dependent torch.Generator
  
      components = self.get_dummy_components()
      components["scheduler"] = PNDMScheduler(skip_prk_steps=True)
      torch.manual_seed(0)
      text_encoder_config = RobertaSeriesConfig(
          hidden_size=32,
          project_dim=32,
          intermediate_size=37,
          layer_norm_eps=1e-05,
          num_attention_heads=4,
          num_hidden_layers=5,
          vocab_size=5002,
      )
      # TODO: remove after fixing the non-deterministic text encoder
      text_encoder = RobertaSeriesModelWithTransformation(
          text_encoder_config
      )
      components["text_encoder"] = text_encoder
      alt_pipe = AltDiffusionPipeline(**components)
      alt_pipe = alt_pipe.to(device)
      alt_pipe.set_progress_bar_config(disable=None)
  
      inputs = self.get_dummy_inputs(device)
      output = alt_pipe(**inputs)
      image = output.images
      image_slice = image[0, -3:, -3:, -1]
  
      assert image.shape == (1, 64, 64, 3)
      expected_slice = np.array(
          [
              0.51605093,
              0.5707241,
              0.47365507,
              0.50578886,
              0.5633877,
              0.4642503,
              0.5182081,
              0.48763484,
              0.49084237,
          ]
      )
  
      assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
  
imports: import gc
  import unittest
  import numpy
  import torch
  from transformers import CLIPTextConfig, CLIPTextModel, XLMRobertaTokenizer
  from diffusers import AltDiffusionPipeline, AutoencoderKL, DDIMScheduler, PNDMScheduler, UNet2DConditionModel
  from diffusers.pipelines.alt_diffusion.modeling_roberta_series import RobertaSeriesConfig, RobertaSeriesModelWithTransformation
  from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, torch_device
  from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
  from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin
label_desc: Use image node_id 6 for calling the AltDiffusionPipelineFastTests obj's underlying member method code with example usage: obj.test_alt_diffusion_pndm() without return types