|
1 | 1 | #######################################################
|
2 |
| -# Copyright (c) 2015, ArrayFire |
| 2 | +# Copyright (c) 2019, ArrayFire |
3 | 3 | # All rights reserved.
|
4 | 4 | #
|
5 | 5 | # This file is distributed under 3-clause BSD license.
|
|
48 | 48 |
|
49 | 49 | """
|
50 | 50 |
|
| 51 | +from .algorithm import ( |
| 52 | + accum, all_true, allTrueByKey, any_true, anyTrueByKey, count, countByKey, diff1, diff2, imax, imin, max, maxByKey, min, minByKey, product, productByKey, scan, scan_by_key, set_intersect, |
| 53 | + set_union, set_unique, sort, sort_by_key, sort_index, sum, sumByKey, where) |
| 54 | +from .arith import ( |
| 55 | + abs, acos, acosh, arg, asin, asinh, atan, atan2, atanh, cast, cbrt, ceil, clamp, conjg, cos, cosh, cplx, erf, erfc, exp, |
| 56 | + expm1, factorial, floor, hypot, imag, isinf, isnan, iszero, lgamma, log, log1p, log2, log10, maxof, minof, |
| 57 | + mod, pow, |
| 58 | + pow2, real, rem, root, round, rsqrt, sigmoid, sign, sin, sinh, sqrt, tan, tanh, tgamma, trunc) |
| 59 | +from .array import ( |
| 60 | + Array, constant_array, display, get_display_dims_limit, read_array, save_array, |
| 61 | + set_display_dims_limit, transpose, transpose_inplace) |
| 62 | +from .base import BaseArray |
| 63 | +from .bcast import broadcast |
| 64 | +from .blas import dot, matmul, matmulNT, matmulTN, matmulTT, gemm |
| 65 | +from .cuda import get_native_id, get_stream, set_native_id |
| 66 | +from .data import ( |
| 67 | + constant, diag, flat, flip, identity, iota, join, lookup, lower, moddims, pad, range, reorder, replace, select, shift, |
| 68 | + tile, upper) |
| 69 | +from .library import ( |
| 70 | + BACKEND, BINARYOP, CANNY_THRESHOLD, COLORMAP, CONNECTIVITY, CONV_DOMAIN, CONV_GRADIENT, CONV_MODE, CSPACE, DIFFUSION, ERR, FLUX, |
| 71 | + HOMOGRAPHY, IMAGE_FORMAT, INTERP, ITERATIVE_DECONV, INVERSE_DECONV, MARKER, MATCH, MATPROP, MOMENT, NORM, PAD, RANDOM_ENGINE, STORAGE, TOPK, VARIANCE, YCC_STD, Dtype, Source, AF_VER_MAJOR, FORGE_VER_MAJOR) |
| 72 | +from .device import ( |
| 73 | + alloc_device, alloc_host, alloc_pinned, device_gc, device_info, device_mem_info, eval, free_device, free_host, |
| 74 | + free_pinned, get_device, get_device_count, get_device_ptr, get_manual_eval_flag, info, |
| 75 | + info_str, init, is_dbl_supported, is_half_supported, is_locked_array, lock_array, lock_device_ptr, print_mem_info, set_device, |
| 76 | + set_manual_eval_flag, sync, unlock_array, unlock_device_ptr) |
| 77 | +from .graphics import Window |
| 78 | +from .image import ( |
| 79 | + anisotropic_diffusion, bilateral, canny, color_space, confidenceCC, dilate, dilate3, erode, erode3, gaussian_kernel, gradient, |
| 80 | + gray2rgb, hist_equal, histogram, hsv2rgb, is_image_io_available, iterativeDeconv, inverseDeconv, load_image, load_image_native, maxfilt, |
| 81 | + mean_shift, minfilt, moments, regions, resize, rgb2gray, rgb2hsv, rgb2ycbcr, rotate, sat, save_image, |
| 82 | + save_image_native, scale, skew, sobel_derivatives, sobel_filter, transform, translate, unwrap, wrap, ycbcr2rgb) |
| 83 | +from .index import Index, ParallelRange, Seq |
| 84 | +from .interop import AF_NUMBA_FOUND, AF_NUMPY_FOUND, AF_PYCUDA_FOUND, AF_PYOPENCL_FOUND, to_array |
| 85 | +from .lapack import ( |
| 86 | + cholesky, cholesky_inplace, det, inverse, is_lapack_available, lu, lu_inplace, norm, pinverse, qr, qr_inplace, rank, solve, |
| 87 | + solve_lu, svd, svd_inplace) |
| 88 | +from .library import ( |
| 89 | + get_active_backend, get_available_backends, get_backend, get_backend_count, get_backend_id, get_device_id, |
| 90 | + get_size_of, safe_call, set_backend) |
| 91 | +from .ml import convolve2GradientNN |
| 92 | +from .random import ( |
| 93 | + Random_Engine, get_default_random_engine, get_seed, randn, randu, set_default_random_engine_type, |
| 94 | + set_seed) |
| 95 | +from .signal import ( |
| 96 | + approx1, approx1_uniform, approx2, approx2_uniform, convolve, convolve1, convolve2, convolve2NN, convolve2_separable, convolve3, dft, fft, fft2, fft2_c2r, |
| 97 | + fft2_inplace, fft2_r2c, fft3, fft3_c2r, fft3_inplace, fft3_r2c, fft_c2r, fft_convolve, fft_convolve1, |
| 98 | + fft_convolve2, fft_convolve3, fft_inplace, fft_r2c, fir, idft, ifft, ifft2, ifft2_inplace, ifft3, ifft3_inplace, |
| 99 | + ifft_inplace, iir, medfilt, medfilt1, medfilt2, set_fft_plan_cache_size) |
| 100 | +from .sparse import ( |
| 101 | + convert_sparse, convert_sparse_to_dense, create_sparse, create_sparse_from_dense, create_sparse_from_host, |
| 102 | + sparse_get_col_idx, sparse_get_info, sparse_get_nnz, sparse_get_row_idx, sparse_get_storage, sparse_get_values) |
| 103 | +from .statistics import corrcoef, cov, mean, meanvar, median, stdev, topk, var |
| 104 | +from .timer import timeit |
| 105 | +from .util import dim4, dim4_to_tuple, implicit_dtype, number_dtype, to_str, get_reversion, get_version, to_dtype, to_typecode, to_c_type |
| 106 | + |
51 | 107 | try:
|
| 108 | + # FIXME: pycuda imported but unused |
52 | 109 | import pycuda.autoinit
|
53 | 110 | except ImportError:
|
54 | 111 | pass
|
55 | 112 |
|
56 |
| -from .library import * |
57 |
| -from .array import * |
58 |
| -from .data import * |
59 |
| -from .util import * |
60 |
| -from .algorithm import * |
61 |
| -from .device import * |
62 |
| -from .blas import * |
63 |
| -from .arith import * |
64 |
| -from .statistics import * |
65 |
| -from .lapack import * |
66 |
| -from .signal import * |
67 |
| -from .image import * |
68 |
| -from .features import * |
69 |
| -from .vision import * |
70 |
| -from .graphics import * |
71 |
| -from .bcast import * |
72 |
| -from .index import * |
73 |
| -from .interop import * |
74 |
| -from .timer import * |
75 |
| -from .random import * |
76 |
| -from .sparse import * |
77 |
| -from .ml import * |
78 |
| - |
79 |
| -# do not export default modules as part of arrayfire |
80 |
| -del ct |
81 |
| -del inspect |
82 |
| -del numbers |
83 |
| -del os |
84 |
| - |
85 |
| -if (AF_NUMPY_FOUND): |
86 |
| - del np |
| 113 | + |
| 114 | +__all__ = [ |
| 115 | + # algorithm |
| 116 | + "accum", "all_true", "allTrueByKey", "any_true", "anyTrueByKey", "count", "countByKey", |
| 117 | + "diff1", "diff2", "imax", "imin", "max", "maxByKey", "min", "minByKey", "product", |
| 118 | + "productByKey", "scan", "scan_by_key", "set_intersect", "set_union", "set_unique", |
| 119 | + "sort", "sort_by_key", "sort_index", "sum", "sumByKey", "where", |
| 120 | + # arith |
| 121 | + "abs", "acos", "acosh", "arg", "asin", "asinh", "atan", "atan2", "atanh", |
| 122 | + "cast", "cbrt", "ceil", "clamp", "conjg", "cos", "cosh", "cplx", "erf", |
| 123 | + "erfc", "exp", "expm1", "factorial", "floor", "hypot", "imag", "isinf", |
| 124 | + "isnan", "iszero", "lgamma", "log", "log1p", "log2", "log10", "maxof", |
| 125 | + "minof", "mod", "pow", "pow2", "real", "rem", "root", "round", "rsqrt", |
| 126 | + "sigmoid", "sign", "sin", "sinh", "sqrt", "tan", "tanh", "tgamma", "trunc", |
| 127 | + # array |
| 128 | + "Array", "constant_array", "display", "get_display_dims_limit", "read_array", |
| 129 | + "save_array", "set_display_dims_limit", "transpose", "transpose_inplace", |
| 130 | + # base |
| 131 | + "BaseArray", |
| 132 | + # bcast |
| 133 | + "broadcast", |
| 134 | + # blas |
| 135 | + "dot", "matmul", "matmulNT", "matmulTN", "matmulTT", "gemm", |
| 136 | + #cuda |
| 137 | + "get_native_id", "get_stream", "set_native_id", |
| 138 | + # data |
| 139 | + "constant", "diag", "flat", "flip", "identity", "iota", "join", "lookup", |
| 140 | + "lower", "moddims", "pad", "range", "reorder", "replace", "select", |
| 141 | + "shift", "tile", "upper", |
| 142 | + # library |
| 143 | + "BACKEND", "BINARYOP", "CANNY_THRESHOLD", "COLORMAP", "CONNECTIVITY", "CONV_DOMAIN", |
| 144 | + "CONV_GRADIENT", "CONV_MODE", "CSPACE", "DIFFUSION", "ERR", "FLUX", "HOMOGRAPHY", |
| 145 | + "IMAGE_FORMAT", "INTERP", "ITERATIVE_DECONV", "INVERSE_DECONV", "MARKER", "MATCH", |
| 146 | + "MATPROP", "MOMENT", "NORM", "PAD", "RANDOM_ENGINE", "STORAGE", "TOPK", "VARIANCE", |
| 147 | + "YCC_STD", "Dtype", "Source", "AF_VER_MAJOR", "FORGE_VER_MAJOR", |
| 148 | + # device |
| 149 | + "alloc_device", "alloc_host", "alloc_pinned", "device_gc", "device_info", "device_mem_info", |
| 150 | + "eval", "free_device", "free_host", "free_pinned", "get_device", "get_device_count", |
| 151 | + "get_device_ptr", "get_manual_eval_flag", "info", "info_str", "init", "is_dbl_supported", |
| 152 | + "is_half_supported", "is_locked_array", "lock_array", "lock_device_ptr", "print_mem_info", |
| 153 | + "set_device", "set_manual_eval_flag", "sync", "unlock_array", "unlock_device_ptr", |
| 154 | + # graphics |
| 155 | + "Window", |
| 156 | + # image |
| 157 | + "anisotropic_diffusion", "bilateral", "canny", "color_space", "confidenceCC", "dilate", "dilate3", |
| 158 | + "erode", "erode3", "gaussian_kernel", "gradient", "gray2rgb", "hist_equal", "histogram", "hsv2rgb", |
| 159 | + "is_image_io_available", "iterativeDeconv", "inverseDeconv", "load_image", "load_image_native", |
| 160 | + "maxfilt", "mean_shift", "minfilt", "moments", "regions", "resize", "rgb2gray", "rgb2hsv", "rgb2ycbcr", |
| 161 | + "rotate", "sat", "save_image", "save_image_native", "scale", "skew", "sobel_derivatives", "sobel_filter", |
| 162 | + "transform", "translate", "unwrap", "wrap", "ycbcr2rgb", |
| 163 | + # index |
| 164 | + "Index", "ParallelRange", "Seq", |
| 165 | + # interop |
| 166 | + "AF_NUMBA_FOUND", "AF_NUMPY_FOUND", "AF_PYCUDA_FOUND", "AF_PYOPENCL_FOUND", "to_array", |
| 167 | + # lapack |
| 168 | + "cholesky", "cholesky_inplace", "det", "inverse", "is_lapack_available", "lu", "lu_inplace", |
| 169 | + "norm", "pinverse", "qr", "qr_inplace", "rank", "solve", "solve_lu", "svd", "svd_inplace", |
| 170 | + # library |
| 171 | + "get_active_backend", "get_available_backends", "get_backend", "get_backend_count", |
| 172 | + "get_backend_id", "get_device_id", "get_size_of", "safe_call", "set_backend", |
| 173 | + # ml |
| 174 | + "convolve2GradientNN", |
| 175 | + # random |
| 176 | + "Random_Engine", "get_default_random_engine", "get_seed", "randn", "randu", |
| 177 | + "set_default_random_engine_type", "set_seed", |
| 178 | + # signal |
| 179 | + "approx1", "approx1_uniform", "approx2", "approx2_uniform", "convolve", "convolve1", |
| 180 | + "convolve2", "convolve2NN", "convolve2_separable", "convolve3", "dft", "fft", |
| 181 | + "fft2", "fft2_c2r", "fft2_inplace", "fft2_r2c", "fft3", "fft3_c2r", "fft3_inplace", |
| 182 | + "fft3_r2c", "fft_c2r", "fft_convolve", "fft_convolve1", "fft_convolve2", "fft_convolve3", |
| 183 | + "fft_inplace", "fft_r2c", "fir", "idft", "ifft", "ifft2", "ifft2_inplace", "ifft3", |
| 184 | + "ifft3_inplace", "ifft_inplace", "iir", "medfilt", "medfilt1", "medfilt2", |
| 185 | + "set_fft_plan_cache_size", |
| 186 | + # sparse |
| 187 | + "convert_sparse", "convert_sparse_to_dense", "create_sparse", "create_sparse_from_dense", |
| 188 | + "create_sparse_from_host", "sparse_get_col_idx", "sparse_get_info", "sparse_get_nnz", |
| 189 | + "sparse_get_row_idx", "sparse_get_storage", "sparse_get_values", |
| 190 | + # statistics |
| 191 | + "corrcoef", "cov", "mean", "meanvar", "median", "stdev", "topk", "var", |
| 192 | + # timer |
| 193 | + "timeit", |
| 194 | + # util |
| 195 | + "dim4", "dim4_to_tuple", "implicit_dtype", "number_dtype", "to_str", "get_reversion", |
| 196 | + "get_version", "to_dtype", "to_typecode", "to_c_type" |
| 197 | +] |
0 commit comments