code: def _run_act_layer_grad(act_type, inplace=True):
      x = torch.rand(10, 1000) * 10
      m = MLP(act_layer=act_type, inplace=inplace)
  
      def _run(x, act_layer=""):
          if act_layer:
              # replace act layer if set
              m.act = create_act_layer(act_layer, inplace=inplace)
          out = m(x)
          l = (out - 0).pow(2).sum()
          return l
  
      x = x.to(device=torch_device)
      m.to(device=torch_device)
  
      out_me = _run(x)
  
      with set_layer_config(scriptable=True):
          out_jit = _run(x, act_type)
  
      assert torch.isclose(out_jit, out_me)
  
      with set_layer_config(no_jit=True):
          out_basic = _run(x, act_type)
  
      assert torch.isclose(out_basic, out_jit)
  
file_path: pytorch-image-models/tests/test_layers.py
imports: import torch
  import torch.nn
  from timm.layers import create_act_layer, set_layer_config
  import importlib
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: _run_act_layer_grad(act_type, inplace) and returns: l