code: def gpu_kernels(self, node, name):
      out_ctype = pygpu.gpuarray.dtype_to_ctype(node.outputs[0].dtype)
      pvals_ctype = pygpu.gpuarray.dtype_to_ctype(node.inputs[0].dtype)
      unis_ctype = pygpu.gpuarray.dtype_to_ctype(node.inputs[1].dtype)
      work_ctype = pygpu.gpuarray.dtype_to_ctype(
          work_dtype(node.inputs[0].dtype)
      )
      write_out_ctype = write_w(node.outputs[0].dtype)
      load_in_ctype = load_w(node.inputs[0].dtype)
      code = """#include "cluda.h"
  
  KERNEL void k_multi_warp_multinomial(
      const ga_size nb_multi,
      const ga_size nb_outcomes,
      GLOBAL_MEM %(pvals_ctype)s *global_pvals,
      const ga_size global_pvals_offset,
      const ga_ssize pvals_row_stride,
      const ga_ssize pvals_col_stride,
      GLOBAL_MEM %(unis_ctype)s *global_unis,
      const ga_size global_unis_offset,
      const ga_ssize unis_stride,
      GLOBAL_MEM %(out_ctype)s *global_outs,
      const ga_size global_outs_offset,
      const ga_ssize outs_row_stride,
      const ga_ssize outs_col_stride
  )
  {
      global_pvals = (GLOBAL_MEM %(pvals_ctype)s *)(((GLOBAL_MEM char *)global_pvals) + global_pvals_offset);
      global_unis = (GLOBAL_MEM %(unis_ctype)s *)(((GLOBAL_MEM char *)global_unis) + global_unis_offset);
      global_outs = (GLOBAL_MEM %(out_ctype)s *)(((GLOBAL_MEM char *)global_outs) + global_outs_offset);
      // each thread takes care of one multinomial draw
      int n = LDIM_0*GID_0 + LID_0;
      if (n < nb_multi)
      {
          %(work_ctype)s cummul = 0.;
          bool done = false;
          const %(work_ctype)s unis_n = %(load_in_ctype)s(global_unis[n*unis_stride]);
          for (ga_size m = 0; m < nb_outcomes; ++m)
          {
              %(work_ctype)s current_out = 0;
              if (!done)
              {
                  cummul += %(load_in_ctype)s(global_pvals[m * pvals_col_stride + n * pvals_row_stride]);
                  if (unis_n < cummul)
                  {
                      current_out = 1;
                      done = true;
                  }
              }
              //write out transposed for speed.
              global_outs[n * outs_col_stride +
                          m * outs_row_stride] = %(write_out_ctype)s(current_out);
          }
      }
  }
  """ % dict(
          out_ctype=out_ctype,
          write_out_ctype=write_out_ctype,
          work_ctype=work_ctype,
          pvals_ctype=pvals_ctype,
          unis_ctype=unis_ctype,
          load_in_ctype=load_in_ctype,
      )
      return [
          Kernel(
              code=code,
              name="k_multi_warp_multinomial",
              params=[
                  pygpu.gpuarray.SIZE,
                  pygpu.gpuarray.SIZE,
                  pygpu.gpuarray.GpuArray,
                  pygpu.gpuarray.SIZE,
                  pygpu.gpuarray.SSIZE,
                  pygpu.gpuarray.SSIZE,
                  pygpu.gpuarray.GpuArray,
                  pygpu.gpuarray.SIZE,
                  pygpu.gpuarray.SSIZE,
                  pygpu.gpuarray.GpuArray,
                  pygpu.gpuarray.SIZE,
                  pygpu.gpuarray.SSIZE,
                  pygpu.gpuarray.SSIZE,
              ],
              flags=Kernel.get_flags(node.outputs[0].dtype),
              objvar="k_multi_warp_multinomial_" + name,
          )
      ]
  
imports: from __future__ import absolute_import, print_function, division
  import warnings
  import theano
  import theano.sandbox.multinomial
  from theano import Apply
  from theano.gof import Op
  from theano.tensor import NotScalarConstantError, get_scalar_constant_value
  from .basic_ops import as_gpuarray_variable, infer_context_name, GpuKernelBase, Kernel, gpuarray_helper_inc_dir
  from .opt import register_opt, op_lifter, register_opt2
  from .type import GpuArrayType
  from .elemwise import GpuDimShuffle
  from theano.scalar import as_scalar
  from .fp16_help import write_w, load_w, work_dtype
label_desc: Use image node_id 6 for calling the GPUAMultinomialFromUniform obj's underlying member method code with example usage: obj.gpu_kernels(node, name) and returns: list