code: def rastrigin(tensor, lib=torch):
      # https://en.wikipedia.org/wiki/Test_functions_for_optimization
      x, y = tensor
      A = 10
      f = (
          A * 2
          + (x**2 - A * lib.cos(x * math.pi * 2))
          + (y**2 - A * lib.cos(y * math.pi * 2))
      )
      return f
  
file_path: pytorch-optimizer/examples/viz_optimizers.py
imports: import math
  import matplotlib.pyplot
  import numpy
  import torch
  from hyperopt import fmin, hp, tpe
  import torch_optimizer
label_desc: Use image node_id 2 for calling a global function with example usage: rastrigin(tensor, lib) and returns: f