code: def _compute_hist(tensor, hist, nbins=64, offset=-48):
      """
      Helper function to compute the histogram of a tensor.
  
      Arguments:
          tensor (GPUTensor): the tensor to compute the histogram over
          hist (gpu pointer): the gpu memory region to store the 64 bin hist in.
          nbins (int, optional): number of histogram bins, each representing a power of 2
                                 (default 64)
          offset (int, optional): offset the value of a bin from its idx as a power of two
                                  (default offset=-48 means bin 0 represents 2**-48)
      """
      threads = 128
      assert nbins < threads and nbins > 0
  
      size = tensor.size
      strides = np.floor(np.sqrt(size) / threads) * threads
      if strides < threads:
          strides = max(size / threads * threads, threads)
  
      blocks = max(1, int(strides) // threads)
  
      kernel_args = [hist, tensor.gpudata, int(strides), size]
      hist_kern = _get_hist_kernel(tensor.dtype.str, nbins, offset)
      hist_kern.prepared_call(
          (blocks, 1, 1), (threads, 1, 1), *kernel_args
      )
  
imports: from __future__ import division
  from future.utils import native_str
  import os.path
  import re
  import traceback
  import numpy
  from pycuda.tools import context_dependent_memoize
  from pytools import memoize
  from neon import logger
  import neon.backends.nervanagpu
  from neon.backends.util.source_module import SourceModule
  from neon.backends.cuda_templates import _ew_template, _stage_template, _fin_template, _init_rand_func, _init_rand_round_func, _finish_rand_func, _common_kepler, _common_urand_gen, _common_frand, _common_round, _common_fp16_to_fp32, _ew_types, _ew_strings, _is_finite, _float_ops, _reduction_ops
  from neon.backends.cuda_batchnorm import _get_bn_fprop_kernel, _get_bn_bprop_kernel
  from neon.backends.kernels.cuda.lookuptable import _get_lut_bprop_kernel, _get_sorting_kernel
label_desc: Use image node_id 13 for calling a global function with example usage: _compute_hist(tensor, hist, nbins, offset) without return types