code: def test_loss_gradient(art_warning, get_pytorch_yolo):
      try:
          object_detector, x_test, y_test = get_pytorch_yolo
  
          grads = object_detector.loss_gradient(x=x_test, y=y_test)
  
          assert grads.shape == (2, 3, 416, 416)
  
          expected_gradients1 = np.asarray(
              [
                  0.012576922,
                  -0.005133151,
                  -0.0028872574,
                  -0.0029357928,
                  -0.008929219,
                  0.012767567,
                  -0.00715934,
                  0.00987368,
                  -0.0014089097,
                  -0.004765472,
                  -0.007845592,
                  -0.0065127434,
                  -0.00047654763,
                  -0.018194549,
                  0.00025652442,
                  -0.01420591,
                  0.03873131,
                  0.080963746,
                  -0.009225381,
                  0.026824722,
                  0.005942673,
                  -0.025760904,
                  0.008754236,
                  -0.037260942,
                  0.027838552,
                  0.0485742,
                  0.020763855,
                  -0.013568859,
                  -0.0071423287,
                  0.000802512,
                  0.012983642,
                  0.006466129,
                  0.0025194373,
                  -0.012298459,
                  -0.01168492,
                  -0.0013298508,
                  -0.007176587,
                  0.01996972,
                  -0.004173076,
                  0.029163878,
                  0.022482246,
                  0.008151911,
                  0.025543496,
                  0.0007374112,
                  0.0008220682,
                  -0.005740379,
                  0.009537468,
                  -0.01116704,
                  0.0010225883,
                  0.00026052812,
              ]
          )
  
          np.testing.assert_array_almost_equal(
              grads[0, 0, 208, 175:225], expected_gradients1, decimal=1
          )
  
          expected_gradients2 = np.asarray(
              [
                  0.0049910736,
                  -0.008941505,
                  -0.013645802,
                  0.0060615,
                  0.0021073571,
                  -0.0022195925,
                  -0.006654369,
                  0.010533731,
                  0.0013077373,
                  -0.010422451,
                  -0.00034834983,
                  -0.0040517827,
                  -0.0001514384,
                  -0.031307846,
                  -0.008412821,
                  -0.044170827,
                  0.055609763,
                  0.0220191,
                  -0.019813634,
                  -0.035893522,
                  0.023970673,
                  -0.08727841,
                  0.0411198,
                  0.0072751334,
                  0.01716753,
                  0.0391037,
                  0.020182624,
                  0.021557821,
                  0.011461802,
                  0.0046976856,
                  -0.00304008,
                  -0.010215744,
                  -0.0074639097,
                  -0.020115864,
                  -0.05325762,
                  -0.006238129,
                  -0.006486116,
                  0.09806269,
                  0.03115965,
                  0.066279344,
                  0.05367205,
                  -0.042338565,
                  0.04456845,
                  0.040167376,
                  0.03357561,
                  0.01510548,
                  0.0006220075,
                  -0.027102726,
                  -0.020182101,
                  -0.04347762,
              ]
          )
          np.testing.assert_array_almost_equal(
              grads[1, 0, 208, 175:225], expected_gradients2, decimal=1
          )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/estimators/object_detection/test_pytorch_yolo.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import numpy
  import pytest
  from tests.utils import ARTTestException
label_desc: Use image node_id 3 for calling a global function with example usage: test_loss_gradient(art_warning, get_pytorch_yolo) without return types