code: def test_embed_correct_order(self):
      # get dataset and encoder
      transform = torchvision.transforms.ToTensor()
      dataset = LightlyDataset(self.folder_path, transform=transform)
      encoder = get_model_from_config(self.cfg)
      if torch.cuda.is_available():
          device = torch.device("cuda")
      else:
          device = torch.device("cpu")
  
      manual_seed(42)
      dataloader_1_worker = DataLoader(
          dataset, shuffle=True, num_workers=0, batch_size=4
      )
      (
          embeddings_1_worker,
          labels_1_worker,
          filenames_1_worker,
      ) = encoder.embed(
          dataloader_1_worker,
          device=device,
      )
  
      manual_seed(43)
      dataloader_4_worker = DataLoader(
          dataset, shuffle=True, num_workers=4, batch_size=4
      )
      (
          embeddings_4_worker,
          labels_4_worker,
          filenames_4_worker,
      ) = encoder.embed(
          dataloader_4_worker,
          device=device,
      )
  
      np.testing.assert_allclose(
          embeddings_1_worker, embeddings_4_worker, atol=5e-4
      )
      np.testing.assert_allclose(
          labels_1_worker, labels_4_worker, atol=1e-5
      )
  
      self.assertListEqual(filenames_1_worker, filenames_4_worker)
      self.assertListEqual(filenames_1_worker, dataset.get_filenames())
  
file_path: lightly/tests/embedding/test_embedding.py
imports: import os
  import tempfile
  import unittest
  from typing import List, Tuple
  import numpy
  import torch
  import torchvision
  from hydra.experimental import compose, initialize
  from torch import manual_seed
  from torch.utils.data import DataLoader
  from lightly.cli._helpers import get_model_from_config
  from lightly.data import LightlyDataset
label_desc: Use image node_id 3 for calling the TestLightlyDataset obj's underlying member method code with example usage: obj.test_embed_correct_order() without return types