docstr: flags: 'int', 'pos', 'scalar', 'row', 'col'
docstr_tok: ["flags",":","'int","'",",","'pos","'",",","'scalar","'",",","'row","'",",","'col","'"]
code: def _rand_gen(self, *flags):
      """
      flags: 'int', 'pos', 'scalar', 'row', 'col'
      """
      val = None
      # dimension
      m = self.m
      n = self.n
      if "scalar" in flags:
          m = 1
          n = 1
      if "row" in flags:
          m = 1
      if "col" in flags:
          n = 1
      # integer
      if "int" in flags:
          if "pos" in flags:
              val = (
                  np.random.randint(5.0, size=(m, n)).astype(float)
                  + 1.0
              )
          else:
              val = (
                  np.random.randint(5.0, size=(m, n)).astype(float)
                  - 2.0
              )
      else:
          if "pos" in flags:
              val = np.absolute(np.random.randn(m, n)) + 0.1
          else:
              val = np.random.randn(m, n)
      # cap it to avoid blowing up
      val[val > 5.0] = 5.0
      val[val < -5.0] = -5.0
      return val
  
imports: from builtins import zip
  import numpy
  import pprint
  import pytest
  from neon import NervanaObject
  from neon.backends.autodiff import Autodiff
  from utils import allclose_with_out
label_desc: Use image node_id 2 for calling the TestAutodiff obj's underlying member method code with example usage: obj._rand_gen() and returns: val