code: def test_array_grad_without_backprop_id(backprop_args):
      array = chainerx.array([1.0, 1.0, 1.0], chainerx.float32)
      grad = chainerx.array([0.5, 0.5, 0.5], chainerx.float32)
  
      with pytest.raises(chainerx.ChainerxError):
          array.get_grad(*backprop_args)
      with pytest.raises(chainerx.ChainerxError):
          array.set_grad(grad, *backprop_args)
      with pytest.raises(chainerx.ChainerxError):
          array.cleargrad(*backprop_args)
  
      # Gradient methods
      array.require_grad().set_grad(grad, *backprop_args)
      assert array.get_grad(*backprop_args) is not None
      assert (
          array.get_grad(*backprop_args)._debug_flat_data
          == grad._debug_flat_data
      )
  
      array.cleargrad(*backprop_args)  # clear
      assert array.get_grad(*backprop_args) is None
  
      array.set_grad(grad, *backprop_args)
      assert array.get_grad(*backprop_args) is not None
      assert (
          array.get_grad(*backprop_args)._debug_flat_data
          == grad._debug_flat_data
      )
  
      array.set_grad(None, *backprop_args)  # clear
      assert array.get_grad(*backprop_args) is None
  
      # Gradient attributes
      array.grad = grad
      assert array.get_grad(*backprop_args) is not None
      assert array.get_grad(*backprop_args) is array.grad
  
      array.grad = None  # clear
      assert array.get_grad(*backprop_args) is None
  
imports: import copy
  import math
  import pickle
  import numpy
  import pytest
  import chainerx
  import chainerx.testing
  from chainerx_tests import array_utils
label_desc: Use image node_id 21 for calling a global function with example usage: test_array_grad_without_backprop_id(backprop_args) without return types