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