docstr: Test that a DatasetArray preserves the ``requires_grad`` attribute
  of array interfaces.
docstr_tok: ["Test","that","a","DatasetArray","preserves","the","``","requires_grad","``","attribute","of","array","interfaces","."]
code: def test_value_init_requires_grad(self, array_class, requires_grad):
      """Test that a DatasetArray preserves the ``requires_grad`` attribute
      of array interfaces."""
      value = array_class([1, 2, 3, 4], requires_grad=requires_grad)
  
      arr = DatasetArray(value)
  
      assert arr.get_value().requires_grad == requires_grad
  
file_path: pennylane/tests/data/attributes/test_array.py
imports: import numpy
  import pytest
  import pennylane.data.attributes.array
  from pennylane import numpy
  from pennylane.data.attributes import DatasetArray
label_desc: Use image node_id 2 for calling the TestDatasetArray obj's underlying member method code with example usage: obj.test_value_init_requires_grad(array_class, requires_grad) without return types