code: def test_activation_deriv(activation, kwargs):
      def get_deriv_autograd(x, act):
          x.attach_grad()
          with autograd.record():
              output = act(x)
          return autograd.grad(output, [x], create_graph=True)[0]
  
      x = mx.nd.random.randn(500, 20)
      act = get_activation(activation, **kwargs)
      act.initialize()
      correct_deriv = get_deriv_autograd(x, act)
      act_deriv = get_activation_deriv(act)
      output_deriv = act_deriv(mx.ndarray, x)
  
      assert np.allclose(
          output_deriv.asnumpy(), correct_deriv.asnumpy(), atol=5e-7
      )
  
imports: import numpy
  import pytest
  import mxnet
  from mxnet import autograd
  from gluonts.mx.activation import get_activation, get_activation_deriv
label_desc: Use image node_id 1 for calling a global function with example usage: test_activation_deriv(activation, kwargs) and returns: autograd