code: def _test_softmax(self, x, x_gpu, f_z, f_gpu_z, cmp):
      # This is basic test for GpuSoftmax and GpuDnnSoftmax
      #
      # We check that we loop when there is too much block
      # We use slower code when there isn't enough shared memory
  
      f_z_out = f_z(x)
      f_gpu_z_out = f_gpu_z(x_gpu)
  
      f = theano.function([x], f_z_out, mode=mode_without_gpu)
      f_gpu = theano.function([x_gpu], f_gpu_z_out, mode=self.mode)
      self._check_types(f, f_gpu, T.nnet.Softmax, self.gpu_op)
  
      # we need to test n>32*1024 to check that we make the block loop.
      cmp(1, 5, f, f_gpu)
      cmp(2, 5, f, f_gpu)
      cmp(10, 5, f, f_gpu)
      cmp(100, 5, f, f_gpu)
      cmp(1000, 5, f, f_gpu)
      cmp(10000, 5, f, f_gpu)
      cmp(4074, 400, f, f_gpu)
      cmp(784, 784, f, f_gpu)
      cmp(4, 1000, f, f_gpu)
      cmp(4, 1024, f, f_gpu)
      cmp(4, 2000, f, f_gpu)
      cmp(4, 2024, f, f_gpu)
      # The GTX285 don't have enough shared memory.
      cmp(4, 4074, f, f_gpu)
      # The GTX580, 680 and kepler don't have enough shared memory.
      cmp(2, 10000, f, f_gpu)
      cmp(128, 16 * 1024, f, f_gpu)
      cmp(128, 64 * 1024, f, f_gpu)
      # cudnn permits no more than 2^15 - 1 rows
      cmp((2 << 15) - 1, 5, f, f_gpu)
      cmp(5, 2 << 15, f, f_gpu)
  
      return f, f_gpu
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  import theano.tensor
  import theano.tests.unittest_tools
  from .config import mode_with_gpu, mode_without_gpu
  from ..nnet import GpuCrossentropySoftmaxArgmax1HotWithBias, GpuCrossentropySoftmax1HotWithBiasDx, GpuSoftmaxWithBias, GpuSoftmax
label_desc: Use image node_id 1 for calling the test_SoftMax obj's underlying member method code with example usage: obj._test_softmax(x, x_gpu, f_z, f_gpu_z, cmp) and returns: f,  f_gpu