code: def test_torch_optimization() -> None:
      module = agents.Perceptron(input_shape=(2,), output_size=1)
      torchopt = helpers.TorchOptimizer(
          module.parameters(), optimizerlib.OnePlusOne
      )
      # pylint: disable=not-callable
      x = module.forward(
          agents.torch.tensor(np.array([2, 3], dtype=np.float32))
      ).item()
      torchopt.step(3.0)
      y = module.forward(
          agents.torch.tensor(np.array([2, 3], dtype=np.float32))
      ).item()
      assert x != y
      # Other instanciations
      helpers.TorchOptimizer(module.parameters(), "OnePlusOne")
      with pytest.raises(TypeError):
          helpers.TorchOptimizer(module.parameters(), 12)
  
file_path: nevergrad/nevergrad/functions/rl/test_agents.py
imports: import numpy
  import pytest
  from nevergrad.optimization import optimizerlib
  from nevergrad.optimization import helpers
  from .None import agents
  from .None import envs
  from .None import base
label_desc: Use image node_id 6 for calling a global function with example usage: test_torch_optimization() without return types