code: def test_torch(data=DATA, hidden_units=128):
      dataset = torch.utils.data.TensorDataset(
          torch.from_numpy(data["X"]).float(),
          torch.from_numpy(data["y"]),
      )
  
      class TorchNetwork(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.layers = torch.nn.Sequential(
                  torch.nn.Linear(data["num_features"], hidden_units),
                  torch.nn.ReLU(),
                  torch.nn.Linear(hidden_units, data["num_classes"]),
              )
  
          def forward(self, X):
              return self.layers(X)
  
      # Test base model works:
      skorch_config = {
          "criterion": torch.nn.CrossEntropyLoss,
          "optimizer": torch.optim.Adam,
      }
      net = skorch.NeuralNet(TorchNetwork, **skorch_config)
      net.fit(dataset, data["y"], epochs=2)
      preds_base = net.predict(dataset)
  
      # Test Cleanlearning performs well:
      net = skorch.NeuralNet(TorchNetwork, **skorch_config)
      cl = CleanLearning(net)
      cl.fit(
          dataset,
          data["y"],
          clf_kwargs={"epochs": 30},
          clf_final_kwargs={"epochs": 60},
      )
  
      preds = cl.predict(dataset).argmax(axis=1)
      err = np.sum(preds != data["y_og"]) / len(data["y_og"])
      issue_indices = list(
          cl.label_issues_df[
              cl.label_issues_df["is_label_issue"]
          ].index.values
      )
      assert issue_indices == data["error_indices"]
      assert err < 1e-3
  
imports: import pytest
  import warnings
  import sys
  import os
  import wget
  from copy import deepcopy
  import random
  import numpy
  import tensorflow
  import torch
  import skorch
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.model_selection import GridSearchCV
  from cleanlab.classification import CleanLearning
  from cleanlab.models.keras import KerasWrapperSequential, KerasWrapperModel
  from cleanlab.internal.util import format_labels
label_desc: Use image node_id 9 for calling a global function with example usage: test_torch(data, hidden_units) and returns: self