docstr: Tests the distributions from a generator object that don't require
  additional distribution-specific parameters to make sure they have a
  ``requires_grad`` attribute.
docstr_tok: ["Tests","the","distributions","from","a","generator","object","that","do","n't","require","additional","distribution-specific","parameters","to","make","sure","they","have","a","``","requires_grad","``","attribute","."]
code: def test_generator_distributions(self, distribution):
      """Tests the distributions from a generator object that don't require
      additional distribution-specific parameters to make sure they have a
      ``requires_grad`` attribute."""
      size = (3,)
      output = getattr(general_gen, distribution)(size=size)
  
      assert isinstance(output, np.tensor)
  
      assert output.shape == size
      assert output.requires_grad is True
  
      output.requires_grad = False
      assert output.requires_grad is False
  
file_path: pennylane/tests/numpy/test_numpy_random.py
imports: import pytest
  from pennylane import numpy
  from pennylane.numpy import random
label_desc: Use image node_id 1 for calling the TestGeneratorDistributions obj's underlying member method code with example usage: obj.test_generator_distributions(distribution) without return types