code: def evaluate(model, X_test, y_test):
      device = torch.device(
          "cuda:0" if torch.cuda.is_available() else "cpu"
      )
      test = torch.utils.data.TensorDataset(
          Variable(torch.FloatTensor(X_test.astype("float32"))),
          Variable(torch.LongTensor(y_test.astype("float32"))),
      )
      test_loader = torch.utils.data.DataLoader(
          test, batch_size=64, shuffle=False
      )
      model.eval()
      correct = 0
      accuracy = 0
      y_pred = []
      with torch.no_grad():
          for images, labels in test_loader:
              images = images.to(device)
              labels = labels.to(device)
              outputs = model(images)
              _, predicted = torch.max(outputs.data, 1)
              predictions = (
                  torch.softmax(outputs.data, dim=1).detach().numpy()
              )
              correct += (
                  predicted.eq(labels.data.view_as(predicted))
                  .sum()
                  .item()
              )
              y_pred += predictions.tolist()
          accuracy = 1.0 * correct / len(test_loader.dataset)
      y_pred = np.array(y_pred)
      return accuracy, y_pred
  
file_path: adversarial-robustness-toolbox/utils/mlops/kubeflow/robustness_evaluation_fgsm_pytorch/src/robustness_util.py
imports: import numpy
  import numpy.linalg
  import torch
  import torch.utils.data
  from torch.autograd import Variable
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(model, X_test, y_test) and returns: accuracy,  y_pred