arrayfire.library moduleΒΆ

Module containing enums and other constants.

class arrayfire.library.BACKEND(value)[source]ΒΆ

Bases: enum.Enum

Backend libraries

CPU = 1ΒΆ
CUDA = 2ΒΆ
DEFAULT = 0ΒΆ
OPENCL = 4ΒΆ
class arrayfire.library.BINARYOP(value)[source]ΒΆ

Bases: enum.Enum

Binary Operators

ADD = 0ΒΆ
MAX = 3ΒΆ
MIN = 2ΒΆ
MUL = 1ΒΆ
class arrayfire.library.CANNY_THRESHOLD(value)[source]ΒΆ

Bases: enum.Enum

Canny Edge Threshold types

AUTO_OTSU = 1ΒΆ
MANUAL = 0ΒΆ
class arrayfire.library.COLORMAP(value)[source]ΒΆ

Bases: enum.Enum

Colormaps

BLUE = 6ΒΆ
COLORS = 2ΒΆ
DEFAULT = 0ΒΆ
HEAT = 5ΒΆ
MOOD = 4ΒΆ
RED = 3ΒΆ
SPECTRUM = 1ΒΆ
class arrayfire.library.CONNECTIVITY(value)[source]ΒΆ

Bases: enum.Enum

Neighborhood connectivity

EIGHT = 8ΒΆ
FOUR = 4ΒΆ
class arrayfire.library.CONV_DOMAIN(value)[source]ΒΆ

Bases: enum.Enum

Convolution domain

AUTO = 0ΒΆ
FREQ = 2ΒΆ
SPATIAL = 1ΒΆ
class arrayfire.library.CONV_GRADIENT(value)[source]ΒΆ

Bases: enum.Enum

Convolution gradient type

BIAS = 3ΒΆ
DATA = 2ΒΆ
DEFAULT = 0ΒΆ
FILTER = 1ΒΆ
class arrayfire.library.CONV_MODE(value)[source]ΒΆ

Bases: enum.Enum

Convolution mode

DEFAULT = 0ΒΆ
EXPAND = 1ΒΆ
class arrayfire.library.CSPACE(value)[source]ΒΆ

Bases: enum.Enum

Colorspace formats

GRAY = 0ΒΆ
HSV = 2ΒΆ
RGB = 1ΒΆ
YCbCr = 3ΒΆ
class arrayfire.library.DIFFUSION(value)[source]ΒΆ

Bases: enum.Enum

Diffusion equations

DEFAULT = 0ΒΆ
GRAD = 1ΒΆ
MCDE = 2ΒΆ
class arrayfire.library.Dtype(value)[source]ΒΆ

Bases: enum.Enum

Error values. For internal use only.

b8 = 4ΒΆ
c32 = 1ΒΆ
c64 = 3ΒΆ
f16 = 12ΒΆ
f32 = 0ΒΆ
f64 = 2ΒΆ
s16 = 10ΒΆ
s32 = 5ΒΆ
s64 = 8ΒΆ
u16 = 11ΒΆ
u32 = 6ΒΆ
u64 = 9ΒΆ
u8 = 7ΒΆ
class arrayfire.library.ERR(value)[source]ΒΆ

Bases: enum.Enum

Error values. For internal use only.

ARG = 202ΒΆ
ARR_BKND_MISMATCH = 503ΒΆ
BATCH = 207ΒΆ
DEVICE = 208ΒΆ
DIFF_TYPE = 205ΒΆ
DRIVER = 102ΒΆ
INTERNAL = 998ΒΆ
INVALID_ARRAY = 201ΒΆ
LOAD_LIB = 501ΒΆ
LOAD_SYM = 502ΒΆ
NONE = 0ΒΆ
NONFREE = 303ΒΆ
NOT_CONFIGURED = 302ΒΆ
NOT_SUPPORTED = 301ΒΆ
NO_DBL = 401ΒΆ
NO_GFX = 402ΒΆ
NO_HALF = 403ΒΆ
NO_MEM = 101ΒΆ
RUNTIME = 103ΒΆ
SIZE = 203ΒΆ
TYPE = 204ΒΆ
UNKNOWN = 999ΒΆ
class arrayfire.library.FLUX(value)[source]ΒΆ

Bases: enum.Enum

Flux functions

DEFAULT = 0ΒΆ
EXPONENTIAL = 2ΒΆ
QUADRATIC = 1ΒΆ
class arrayfire.library.HOMOGRAPHY(value)[source]ΒΆ

Bases: enum.Enum

Homography Types

LMEDS = 1ΒΆ
RANSAC = 0ΒΆ
class arrayfire.library.IMAGE_FORMAT(value)[source]ΒΆ

Bases: enum.Enum

Image Formats

BMP = 0ΒΆ
EXR = 29ΒΆ
HDR = 26ΒΆ
ICO = 1ΒΆ
JNG = 3ΒΆ
JP2 = 31ΒΆ
JPEG = 2ΒΆ
PNG = 13ΒΆ
PPM = 14ΒΆ
PPMRAW = 15ΒΆ
PSD = 20ΒΆ
RAW = 34ΒΆ
TIFF = 18ΒΆ
class arrayfire.library.INTERP(value)[source]ΒΆ

Bases: enum.Enum

Interpolation method

BICUBIC = 7ΒΆ
BICUBIC_SPLINE = 9ΒΆ
BILINEAR = 2ΒΆ
BILINEAR_COSINE = 6ΒΆ
CUBIC = 3ΒΆ
CUBIC_SPLINE = 8ΒΆ
LINEAR = 1ΒΆ
LINEAR_COSINE = 5ΒΆ
LOWER = 4ΒΆ
NEAREST = 0ΒΆ
class arrayfire.library.INVERSE_DECONV(value)[source]ΒΆ

Bases: enum.Enum

Inverse deconvolution algorithm

DEFAULT = 0ΒΆ
TIKHONOV = 1ΒΆ
class arrayfire.library.ITERATIVE_DECONV(value)[source]ΒΆ

Bases: enum.Enum

Iterative deconvolution algorithm

DEFAULT = 0ΒΆ
LANDWEBER = 1ΒΆ
RICHARDSONLUCY = 2ΒΆ
class arrayfire.library.MARKER(value)[source]ΒΆ

Bases: enum.Enum

Markers used for different points in graphics plots

CIRCLE = 2ΒΆ
CROSS = 5ΒΆ
NONE = 0ΒΆ
PLUS = 6ΒΆ
POINT = 1ΒΆ
SQUARE = 3ΒΆ
STAR = 7ΒΆ
TRIANGE = 4ΒΆ
class arrayfire.library.MATCH(value)[source]ΒΆ

Bases: enum.Enum

Match type

LSAD = 2ΒΆ

Sum of squared differences

LSSD = 5ΒΆ

Normalized cross correlation

NCC = 6ΒΆ

Zero mean NCC

SAD = 0ΒΆ

Zero mean SAD

SHD = 8ΒΆ
SSD = 3ΒΆ

Zero mean SSD

ZNCC = 7ΒΆ

Sum of hamming distances

ZSAD = 1ΒΆ

Locally scaled SAD

ZSSD = 4ΒΆ

Locally scaled SSD

class arrayfire.library.MATPROP(value)[source]ΒΆ

Bases: enum.Enum

Matrix properties

BLOCK_DIAG = 8192ΒΆ
CTRANS = 2ΒΆ

Upper triangular matrix.

DIAG_UNIT = 128ΒΆ

Symmetric matrix.

LOWER = 64ΒΆ

Treat diagonal as units.

NONE = 0ΒΆ

Transposed.

ORTHOG = 2048ΒΆ

Tri diagonal matrix.

POSDEF = 1024ΒΆ

Orthogonal matrix.

SYM = 512ΒΆ

Positive definite matrix.

TRANS = 1ΒΆ

Conjugate transposed.

TRI_DIAG = 4096ΒΆ

Block diagonal matrix.

UPPER = 32ΒΆ

Lower triangular matrix.

class arrayfire.library.MOMENT(value)[source]ΒΆ

Bases: enum.Enum

Image Moments types

FIRST_ORDER = 15ΒΆ
M00 = 1ΒΆ
M01 = 2ΒΆ
M10 = 4ΒΆ
M11 = 8ΒΆ
class arrayfire.library.NORM(value)[source]ΒΆ

Bases: enum.Enum

Norm types

EUCLID = 2ΒΆ
MATRIX_1 = 4ΒΆ
MATRIX_2 = 6ΒΆ
MATRIX_INF = 5ΒΆ
MATRIX_L_PQ = 7ΒΆ
VECTOR_1 = 0ΒΆ
VECTOR_2 = 2ΒΆ
VECTOR_INF = 1ΒΆ
VECTOR_P = 3ΒΆ
class arrayfire.library.PAD(value)[source]ΒΆ

Bases: enum.Enum

Edge padding types

CLAMP_TO_EDGE = 2ΒΆ
PERIODIC = 3ΒΆ
SYM = 1ΒΆ
ZERO = 0ΒΆ
class arrayfire.library.RANDOM_ENGINE(value)[source]ΒΆ

Bases: enum.Enum

Random engine types

DEFAULT = 100ΒΆ
MERSENNE_GP11213 = 300ΒΆ
PHILOX = 100ΒΆ
PHILOX_4X32_10 = 100ΒΆ
THREEFRY = 200ΒΆ
THREEFRY_2X32_16 = 200ΒΆ
class arrayfire.library.STORAGE(value)[source]ΒΆ

Bases: enum.Enum

Matrix Storage types

COO = 3ΒΆ
CSC = 2ΒΆ
CSR = 1ΒΆ
DENSE = 0ΒΆ
class arrayfire.library.Source(value)[source]ΒΆ

Bases: enum.Enum

Source of the pointer

device = 0ΒΆ
host = 1ΒΆ
class arrayfire.library.TOPK(value)[source]ΒΆ

Bases: enum.Enum

Top-K ordering

DEFAULT = 0ΒΆ
MAX = 2ΒΆ
MIN = 1ΒΆ
class arrayfire.library.VARIANCE(value)[source]ΒΆ

Bases: enum.Enum

Variance bias type

DEFAULT = 0ΒΆ
POPULATION = 2ΒΆ
SAMPLE = 1ΒΆ
class arrayfire.library.YCC_STD(value)[source]ΒΆ

Bases: enum.Enum

YCC Standard formats

BT_2020 = 2020ΒΆ
BT_601 = 601ΒΆ
BT_709 = 709ΒΆ
class arrayfire.library.af_cdouble_t[source]ΒΆ

Bases: _ctypes.Structure

Attributes
imag

Structure/Union member

real

Structure/Union member

imagΒΆ

Structure/Union member

realΒΆ

Structure/Union member

class arrayfire.library.af_cfloat_t[source]ΒΆ

Bases: _ctypes.Structure

Attributes
imag

Structure/Union member

real

Structure/Union member

imagΒΆ

Structure/Union member

realΒΆ

Structure/Union member

arrayfire.library.get_active_backend()[source]ΒΆ

Get the current active backend

namestr.

Backend name

arrayfire.library.get_available_backends()[source]ΒΆ

Get names of available backends

Returns
namestuple of strings

Names of available backends

arrayfire.library.get_backend()[source]ΒΆ

Return the name of the backend

arrayfire.library.get_backend_count()[source]ΒΆ

Get number of available backends

Returns
countint

Number of available backends

arrayfire.library.get_backend_id(A)[source]ΒΆ

Get backend name of an array

Parameters
Aaf.Array
Returns
namestr.

Backend name

arrayfire.library.get_device_id(A)[source]ΒΆ

Get the device id of the array

Parameters
Aaf.Array
Returns
devInteger

id of the device array was created on

arrayfire.library.get_size_of(dtype)[source]ΒΆ

Get the size of the type represented by arrayfire.Dtype

arrayfire.library.set_backend(name, unsafe=False)[source]ΒΆ

Set a specific backend by name

Parameters
namestr.
unsafeoptional: bool. Default: False.

If False, does not switch backend if current backend is not unified backend.