code: def c_code(self, node, nodename, inp, out, sub):
      return """
          npy_int64 M1 = 2147483647;      //2^31 - 1
          size_t n_elements = 1;
          unsigned int n_streams;
          int must_alloc_sample = ((NULL == %(o_sample)s)
                  || !pygpu_GpuArray_Check((PyObject*)%(o_sample)s)
                  || !(%(o_sample)s->ga.flags & GA_C_CONTIGUOUS)
                  || (PyGpuArray_NDIM(%(o_sample)s) != %(params)s->ndim));
  
          size_t* odims = (size_t*)malloc(%(params)s->ndim * sizeof(size_t));
          if (odims == NULL) {
              PyErr_NoMemory();
              %(just_fail)s
          }
  
          if (PyArray_NDIM(%(size)s) != 1)
          {
              PyErr_SetString(PyExc_ValueError, "size must be vector");
              %(fail)s
          }
          if (PyArray_DIMS(%(size)s)[0] != %(params)s->ndim)
          {
              PyErr_Format(PyExc_ValueError, "size must have length %%i (not %%li)",
                  %(params)s->ndim, PyArray_DIMS(%(size)s)[0]);
              %(fail)s
          }
  
          for (int i = 0; i < %(params)s->ndim; ++i)
          {
              odims[i] = *(dtype_%(size)s *)PyArray_GETPTR1(%(size)s, i);
              n_elements *= odims[i];
              must_alloc_sample = (must_alloc_sample
                      || PyGpuArray_DIMS(%(o_sample)s)[i] != odims[i]);
          }
  
          if (n_elements > M1)
          {
              PyErr_SetString(
                  PyExc_ValueError,
                  "rng_mrg gpu implementation does not support more than (2**31 -1) samples");
              %(fail)s
          }
          if (must_alloc_sample)
          {
              Py_XDECREF(%(o_sample)s);
              %(o_sample)s = pygpu_empty(%(params)s->ndim, odims, %(params)s->otypecode, GA_C_ORDER,
                                         %(params)s->context, Py_None);
              if(!%(o_sample)s)
              {
                  %(fail)s;
              }
          }
          if (!pygpu_GpuArray_Check((PyObject*)%(rstate)s))
          {
              PyErr_Format(PyExc_ValueError, "rstate must be gpuarray");
              %(fail)s;
          }
  
          Py_XDECREF(%(o_rstate)s);
          if (%(params)s->inplace)
          {
              Py_INCREF(%(rstate)s);
              %(o_rstate)s = %(rstate)s;
          }
          else
          {
              %(o_rstate)s = pygpu_copy(%(rstate)s, GA_ANY_ORDER);
              if (!%(o_rstate)s) {
                  %(fail)s
              }
          }
  
          if (PyGpuArray_NDIM(%(o_rstate)s) != 2)
          {
              PyErr_SetString(PyExc_ValueError, "rstate must be a matrix");
              %(fail)s
          }
          if (PyGpuArray_DIMS(%(o_rstate)s)[1] != 6)
          {
              PyErr_Format(PyExc_ValueError, "rstate must have 6 columns");
              %(fail)s
          }
          if (%(o_rstate)s->ga.typecode != GA_INT) {
              PyErr_Format(PyExc_ValueError, "rstate must be int32");
              %(fail)s
          }
          if (!GpuArray_CHKFLAGS(&%(o_rstate)s->ga, GA_C_CONTIGUOUS)) {
              PyErr_Format(PyExc_ValueError, "rstate must be C contiguous");
              %(fail)s
          }
          n_streams = PyGpuArray_DIMS(%(o_rstate)s)[0];
          if (n_streams > n_elements)
            n_streams = n_elements;
  
          if (n_elements > 0){
            size_t ls = 0, gs = 0;
            int err = GpuKernel_sched(&%(kname)s, n_streams, &ls, &gs);
            if (err != GA_NO_ERROR) {
                PyErr_Format(PyExc_RuntimeError, "GpuKernel_sched: %%s\\n",
                             GpuKernel_error(&%(kname)s, err));
                %(fail)s
            }
            // Make sure we run as many blocks as we need to cover the whole n_streams
            gs = (n_streams + ls - 1)/ls;
            err = mrg_uniform_call(1, &ls, &gs, 0, %(o_sample)s->ga.data, %(o_sample)s->ga.offset, %(o_rstate)s->ga.data, %(o_rstate)s->ga.offset, n_elements, n_streams);
            if (err != GA_NO_ERROR) {
                PyErr_Format(PyExc_RuntimeError, "mrg_uniform_call: %%s\\n",
                             GpuKernel_error(&%(kname)s, err));
                %(fail)s
            }
          }
  
          free(odims);
          """ % dict(
          rstate=inp[0],
          size=inp[1],
          o_rstate=out[0],
          o_sample=out[1],
          kname=self.gpu_kernels(node, nodename)[0].objvar,
          params=sub["params"],
          just_fail=sub["fail"],
          fail="""
                     {
                       free(odims);
                       %(fail)s
                     }
                     """
          % dict(fail=sub["fail"]),
      )
  
imports: from __future__ import absolute_import, print_function, division
  from theano import Apply, tensor
  from theano.gof import local_optimizer
  from theano.sandbox.rng_mrg import mrg_uniform_base, mrg_uniform
  from theano.tensor import as_tensor_variable, get_vector_length
  from theano.scalar import int32
  from .basic_ops import GpuKernelBase, Kernel, infer_context_name, GpuFromHost, host_from_gpu, as_gpuarray_variable
  from .type import GpuArrayType, gpu_context_type
  from .fp16_help import write_w
  from .opt import register_opt, register_opt2
label_desc: Use image node_id 6 for calling the GPUA_mrg_uniform obj's underlying member method code with example usage: obj.c_code(node, nodename, inp, out, sub) and returns: unknown