code: def test_loaders(
      seed=0,
  ):
      """This is going to OVERFIT - train and test on the SAME SET.
      The goal of this test is just to make sure the data loads correctly.
      And all the main functions work."""
  
      from cleanlab.count import (
          estimate_confident_joint_and_cv_pred_proba,
          estimate_latent,
      )
  
      np.random.seed(seed)
      filter_by = "prune_by_noise_rate"
      # Pre-train for only 3 epochs (it maxes out around 8-12 epochs)
      cnn = CNN(
          epochs=3,
          log_interval=None,
          seed=seed,
          dataset="sklearn-digits",
      )
      score = 0
      for loader in ["train", "test", None]:
          print("loader:", loader)
          prev_score = score
          X = X_test_idx if loader == "test" else X_train_idx
          y = true_labels_test if loader == "test" else y_train
          # Setting this overrides all future functions.
          cnn.loader = loader
          # pre-train (overfit, not out-of-sample) to entire dataset.
          cnn.fit(
              X,
              None,
          )
          # This next block of code checks if cleanlab works with the CNN
          # Out-of-sample cross-validated holdout predicted probabilities
          np.random.seed(seed)
          # Single epoch for cross-validation (already pre-trained)
          cnn.epochs = 1
          cj, pred_probs = estimate_confident_joint_and_cv_pred_proba(
              X, y, cnn, cv_n_folds=2
          )
          est_py, est_nm, est_inv = estimate_latent(cj, y)
          # algorithmic identification of label issues
          err_idx = cleanlab.filter.find_label_issues(
              y, pred_probs, confident_joint=cj, filter_by=filter_by
          )
          assert err_idx is not None
  
          # Get prediction on loader set.
          pred = cnn.predict(X)
          score = accuracy_score(y, pred)
          print(
              "Acc Before: {:.2f}, After: {:.2f}".format(
                  prev_score, score
              )
          )
          assert score > prev_score
  
file_path: cleanlab/tests/test_model_pytorch_cnn.py
imports: from cleanlab.experimental.mnist_pytorch import CNN, SKLEARN_DIGITS_TEST_SIZE, SKLEARN_DIGITS_TRAIN_SIZE
  import cleanlab
  import numpy
  from sklearn.metrics import accuracy_score
  from sklearn.datasets import load_digits
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_loaders(seed) without return types