def get_device_type_sizes():
 if hasattr(get_device_type_sizes, 'rval'):
  return get_device_type_sizes.rval
 gpu_ptr_size = 8
 cpu_ptr_size = 8
 int_size = 8
 try:
  cuda_ndarray = theano.sandbox.cuda.cuda_ndarray.cuda_ndarray
  t = cuda_ndarray.ptr_int_size()
  (gpu_ptr_size, cpu_ptr_size, int_size, gpu_int_size) = t
  assert (int_size == gpu_int_size), (int_size, gpu_int_size)
  del gpu_int_size
  del t
 except Exception as e:
  _logger.warning(('Optimization Warning: Got the following error, but you can ignore it. This could cause less GpuElemwise fused together.\n%s' % e))
 rval = get_device_type_sizes.rval = dict(gpu_ptr_size=gpu_ptr_size, cpu_ptr_size=cpu_ptr_size, int_size=int_size)
 return rval

def get_device_type_sizes ( ) : if hasattr ( get_device_type_sizes , 'rval' ) : return get_device_type_sizes . rval gpu_ptr_size = 8 cpu_ptr_size = 8 int_size = 8 try : cuda_ndarray = theano . sandbox . cuda . cuda_ndarray . cuda_ndarray t = cuda_ndarray . ptr_int_size ( ) ( gpu_ptr_size , cpu_ptr_size , int_size , gpu_int_size ) = t assert ( int_size == gpu_int_size ) , ( int_size , gpu_int_size ) del gpu_int_size del t except Exception as e : _logger . warning ( ( 'Optimization Warning: Got the following error, but you can ignore it. This could cause less GpuElemwise fused together.\n%s' % e ) ) rval = get_device_type_sizes . rval = dict ( gpu_ptr_size = gpu_ptr_size , cpu_ptr_size = cpu_ptr_size , int_size = int_size ) return rval
returns tuple (gpu ptr size .