Module Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier ImportFrom alias alias ImportFrom alias identifier ImportFrom alias identifier Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str ImportFrom alias Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr If CompareLt AttributeLoad NameLoad attr Num body Assign NameStore Num orelse Assign NameStore Num Assign NameStore Num Assign NameStore TupleLoad NameLoad NameLoad Num Assign NameStore TupleLoad BinOpAdd Call NameLoad BinOpDiv NameLoad NameLoad Num Num Assign NameStore BinOpMult Num BinOpAdd BinOpMult BinOpAdd NameLoad Num NameLoad BinOpMult Num NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Return NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If NameLoad body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num orelse Assign NameStore NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str orelse Assign NameStore Call AttributeLoad NameLoad attr Str If Call NameLoad NameLoad NameLoad body If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareEq BinOpMod NameLoad Num Num body AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpMult Num BinOpAdd BinOpMult SubscriptLoad NameLoad Index Num NameLoad BinOpMult Num SubscriptLoad NameLoad Index Num Expr Call NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Return NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str ImportFrom alias Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpMult AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad BinOpMult AttributeLoad NameLoad attr Num Assign NameStore BinOpMult Num AttributeLoad NameLoad attr If CompareEq SubscriptLoad NameLoad Index Num Num body Assign NameStore Num orelse Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore BoolOpAnd CompareLt BinOpMult Num BinOpAdd BinOpMult NameLoad NameLoad BinOpMult Num NameLoad NameLoad CompareLt BinOpMult BinOpMult NameLoad NameLoad NameLoad NameLoad Return BoolOpAnd NameLoad CompareLtE BinOpMult NameLoad NameLoad NameLoad decorator_list Assign NameStore Num While Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body AugAssignAdd NameStore Num AugAssignSub NameStore Num Assign NameStore BinOpAdd Call NameLoad BinOpDiv NameLoad NameLoad Num Return TupleLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad Num decorator_list If CompareEq NameLoad Str body Assign NameStore Num Assign NameStore Num Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Print NameLoad Call AttributeLoad NameLoad attr
N/A N/A numpy np N/A gpustats.kernels kernels N/A gpustats.codegen codegen N/A gpustats.util util N/A pycuda.driver drv pycuda.gpuarray GPUArray to_gpu pycuda.gpuarray empty gpu_empty pycuda.curandom rand curand N/A cu_module N/A N/A codegen get_full_cuda_module sample_discrete N/A N/A densities logged return_gpuarray N/A False False N/A N/A 
    Takes a categorical sample from the unnormalized univariate
    densities defined in the rows of 'densities'

    Parameters
    ---------
    densities : ndarray or gpuarray (n, k)
    logged: boolean indicating whether densities is on the
    log scale ...

    Returns
    -------
    indices : ndarray or gpuarray (if return_gpuarray=True)
    of length n and dtype = int32
     gpustats.util info N/A N/A n k N/A densities shape N/A N/A isinstance densities GPUArray N/A N/A N/A N/A densities flags f_contiguous N/A N/A gpu_densities N/A N/A util transpose densities N/A N/A gpu_densities densities N/A N/A densities N/A N/A util prep_ndarray densities N/A gpu_densities N/A to_gpu densities N/A cu_func N/A N/A cu_module get_function sample_discrete N/A gpu_random N/A to_gpu N/A N/A np asarray N/A N/A N/A np random rand n dtype N/A np float32 N/A gpu_dest N/A gpu_empty n dtype N/A np int32 N/A dims N/A N/A np array N/A n k logged dtype N/A np int32 N/A N/A N/A info max_block_threads 1024 N/A N/A x_block_dim 16 N/A N/A x_block_dim 32 N/A y_block_dim 16 N/A block_design N/A x_block_dim y_block_dim 1 N/A grid_design N/A N/A N/A int N/A n y_block_dim 1 1 N/A shared_mem N/A 4 N/A N/A N/A x_block_dim 1 y_block_dim N/A 2 y_block_dim N/A N/A cu_func gpu_densities gpu_random gpu_dest N/A dims N/A 0 N/A dims N/A 1 N/A dims N/A 2 block block_design grid grid_design shared shared_mem N/A N/A N/A N/A gpu_random gpudata free N/A return_gpuarray N/A N/A gpu_dest N/A N/A res N/A N/A gpu_dest get N/A N/A N/A N/A gpu_dest gpudata free N/A res N/A sample_discrete_old N/A N/A in_densities logged pad return_gpuarray N/A False False False N/A N/A 
    Takes a categorical sample from the unnormalized univariate
    densities defined in the rows of 'densities'

    Parameters
    ---------
    densities : ndarray or gpuarray (n, k)
    logged: boolean indicating whether densities is on the
    log scale ...

    Returns
    -------
    indices : ndarray or gpuarray (if return_gpuarray=True)
    of length n and dtype = int32
     N/A pad N/A N/A logged N/A N/A densities N/A N/A util pad_data_mult16 in_densities fill 1 N/A N/A densities N/A N/A util pad_data_mult16 in_densities fill 0 N/A N/A densities in_densities N/A N/A n k N/A densities shape N/A logged N/A N/A cu_func N/A N/A cu_module get_function sample_discrete_logged_old N/A N/A cu_func N/A N/A cu_module get_function sample_discrete_old N/A N/A isinstance densities GPUArray N/A N/A N/A N/A densities flags f_contiguous N/A N/A gpu_densities N/A N/A util transpose densities N/A N/A gpu_densities densities N/A N/A densities N/A N/A util prep_ndarray densities N/A gpu_densities N/A to_gpu densities N/A gpu_random N/A to_gpu N/A N/A np asarray N/A N/A N/A np random rand n dtype N/A np float32 N/A gpu_dest N/A gpu_empty n dtype N/A np float32 N/A stride N/A N/A gpu_densities shape N/A 1 N/A N/A N/A stride 2 0 N/A N/A stride 1 N/A dims N/A N/A np array N/A n k N/A N/A gpu_densities shape N/A 1 stride dtype N/A np int32 N/A N/A grid_design block_design N/A _tune_sfm n stride N/A cu_func num_regs N/A shared_mem N/A 4 N/A N/A N/A block_design N/A 0 stride N/A 1 N/A block_design N/A 0 N/A N/A cu_func gpu_densities gpu_random gpu_dest N/A dims N/A 0 N/A dims N/A 1 N/A dims N/A 2 N/A dims N/A 3 block block_design grid grid_design shared shared_mem N/A N/A N/A N/A gpu_random gpudata free N/A return_gpuarray N/A N/A gpu_dest N/A N/A res N/A N/A gpu_dest get N/A N/A N/A N/A gpu_dest gpudata free N/A res N/A _tune_sfm N/A N/A n stride func_regs N/A N/A N/A 
    Outputs the 'opimal' block and grid configuration
    for the sample discrete kernel.
     gpustats.util info N/A comp_cap N/A info compute_cap N/A max_smem N/A N/A info shared_mem 0.8 N/A max_threads N/A int N/A N/A info max_block_threads 0.5 N/A max_regs N/A 0.9 N/A info max_registers N/A N/A N/A comp_cap N/A 0 1 N/A N/A xdim 16 N/A N/A xdim 32 sfm_config_ok N/A N/A xdim ydim stride func_regs max_regs max_smem max_threads N/A N/A N/A ok N/A N/A N/A 4 N/A N/A xdim stride N/A 1 xdim max_smem N/A N/A N/A func_regs ydim xdim max_regs N/A N/A ok N/A N/A xdim ydim max_threads N/A N/A ydim 2 N/A N/A sfm_config_ok xdim ydim stride func_regs max_regs max_smem max_threads N/A N/A ydim 1 N/A ydim 1 N/A nblocks N/A N/A int N/A n xdim 1 N/A N/A N/A nblocks 1 N/A xdim ydim 1 N/A N/A N/A __name__ __main__ N/A N/A n 100 N/A k 5 N/A dens N/A N/A N/A np log N/A N/A np abs N/A N/A N/A np random randn k 200 N/A densities N/A N/A N/A dens copy N/A _ N/A range n N/A dens N/A N/A np exp N/A dens 200 N/A densities N/A N/A np asarray densities N/A labels N/A sample_discrete densities logged True N/A mu N/A N/A np dot N/A dens N/A N/A dens sum N/A N/A np arange k N/A mu N/A N/A labels mean