code: def random_matrix(self, shape, dtype, scale, sym=False):
      m, n = shape[-2:]
      dtype = numpy.dtype(dtype)
      assert dtype.kind in "iufc"
      low_s, high_s = scale
      bias = None
      if dtype.kind in "iu":
          err = numpy.sqrt(m * n) / 2.0
          low_s += err
          high_s -= err
          if dtype.kind in "u":
              assert sym, (
                  "generating nonsymmetric matrix with uint cells is not"
                  " supported"
              )
              # (singular value of numpy.ones((m, n))) <= \sqrt{mn}
              high_s = bias = high_s / (1 + numpy.sqrt(m * n))
      assert low_s <= high_s
      a = numpy.random.standard_normal(shape)
      u, s, vh = numpy.linalg.svd(a)
      new_s = numpy.random.uniform(low_s, high_s, s.shape)
      if sym:
          assert m == n
          new_a = numpy.einsum("...ij,...j,...kj", u, new_s, u)
      else:
          new_a = numpy.einsum("...ij,...j,...jk", u, new_s, vh)
      if bias is not None:
          new_a += bias
      if dtype.kind in "iu":
          new_a = numpy.rint(new_a)
      return new_a.astype(dtype)
  
file_path: chainer/tests/chainer_tests/functions_tests/math_tests/test_cholesky.py
imports: import numpy
  import chainer.functions
  from chainer import testing
label_desc: Use image node_id 1 for calling the TestCholesky obj's underlying member method code with example usage: obj.random_matrix(shape, dtype, scale, sym) and returns: new_a