MLXBackend#

class MLXBackend(device='cpu', float_dtype=None, complex_dtype=None, int_dtype=None, overflow_safe_dtype=None, **kwargs)[source]#

Bases: NumpyFFTWBackend

A mlx-based matching backend.

Methods

MLXBackend.abs(*args, **kwargs)

Compute the absolute of array elements.

MLXBackend.add(x1, x2[, out])

Element-wise addition of arrays.

MLXBackend.arange(*args, **kwargs)

Arange values in evenly spaced interval.

MLXBackend.argsort(*args, **kwargs)

Compute the indices to sort a given input array.

MLXBackend.astype(arr, dtype)

Change the datatype of arr.

MLXBackend.build_fft(fast_shape, ...)

Build fft builder functions.

MLXBackend.center_of_mass(arr[, cutoff])

Computes the center of mass of a numpy ndarray instance using all available elements.

MLXBackend.clip(*args, **kwargs)

Clip elements of arr.

MLXBackend.compute_convolution_shapes(...)

Computes regular, optimized and fourier convolution shape.

MLXBackend.concatenate(*args, **kwargs)

Join a sequence of objects along an existing axis.

MLXBackend.datatype_bytes(dtype)

Return the number of bytes occupied by a given datatype.

MLXBackend.device_count()

Returns the number of available GPU devices.

MLXBackend.divide(*args, **kwargs)

Element-wise division of arrays.

MLXBackend.dot(*args, **kwargs)

MLXBackend.einsum(*args, **kwargs)

Compute the einstein notation based summation.

MLXBackend.eps(dtype)

Returns the minimal difference representable by dtype.

MLXBackend.extract_center(arr, newshape)

Extract the centered portion of an array based on a new shape.

MLXBackend.fill(arr, value)

Fills arr in-place with a given value.

MLXBackend.free_cache()

Free cached objects allocated by backend.

MLXBackend.from_sharedarr(arr)

Returns an array of given shape and dtype from shared memory location.

MLXBackend.full(shape, fill_value[, dtype])

Returns an array filled with fill_value of specified shape and dtype.

MLXBackend.get_available_memory()

Returns the available memory available for computations in bytes.

MLXBackend.get_fundamental_dtype(arr)

Given an array instance, returns the corresponding fundamental python type, i.e., int, float or complex.

MLXBackend.identity(*args, **kwargs)

MLXBackend.indices(arr)

Creates an array representing the index grid of an input.

MLXBackend.max(*args, **kwargs)

Compute the maximum of array elements.

MLXBackend.max_filter_coordinates(...)

Identifies local maxima in score_space separated by min_distance.

MLXBackend.max_score_over_rotations(scores, ...)

Update elements in max_scores and rotations where scores is larger than max_scores with score and rotation_index, respectivelty.

MLXBackend.maximum(*args, **kwargs)

Compute the element wise maximum of arr1 and arr2.

MLXBackend.mean(*args, **kwargs)

Compute the mean of array elements.

MLXBackend.min(*args, **kwargs)

Compute the minimum of array elements.

MLXBackend.minimum(*args, **kwargs)

Compute the element wise minimum of arr1 and arr2.

MLXBackend.mod(arr1, arr2[, out])

Element-wise modulus of arrays.

MLXBackend.multiply(x1, x2[, out])

Element-wise multiplication of arrays.

MLXBackend.norm_scores(arr, exp_sq, sq_exp, ...)

Normalizes arr by the standard deviation ensuring numerical stability.

MLXBackend.power(*args, **kwargs)

Compute the n-th power of an array.

MLXBackend.repeat(*args, **kwargs)

Repeat each array element a specified number of times.

MLXBackend.reshape(*args, **kwargs)

MLXBackend.reverse(arr)

Reverse the order of elements in an array along all its axes.

MLXBackend.rigid_transform(arr, rotation_matrix)

Performs a rigid transformation.

MLXBackend.roll(a, shift, axis, **kwargs)

Roll array elements along a specified axis.

MLXBackend.set_device(device_index)

Context manager that sets active compute device device for operations.

MLXBackend.size(arr)

Compute the number of elements of arr.

MLXBackend.sqrt(*args, **kwargs)

Compute the square root of array elements.

MLXBackend.square(*args, **kwargs)

Compute the square of array elements.

MLXBackend.stack(*args, **kwargs)

Join a sequence of objects along a new axis.

MLXBackend.std(arr, axis)

Compute the standad deviation of array elements.

MLXBackend.subtract(*args, **kwargs)

Element-wise subtraction of arrays.

MLXBackend.sum(*args, **kwargs)

Compute the sum of array elements.

MLXBackend.to_backend_array(arr)

Convert a numpy array instance to backend array type.

MLXBackend.to_cpu_array(arr)

Convert an array of a given backend to a CPU array of that backend.

MLXBackend.to_numpy_array(arr)

Convert an array of given backend to a numpy array.

MLXBackend.to_sharedarr(arr[, ...])

Converts an array to an object shared in memory.

MLXBackend.tobytes(arr)

Compute the bytestring representation of arr.

MLXBackend.topk_indices(arr, k)

Determinces the indices of largest elements.

MLXBackend.topleft_pad(arr, shape[, padval])

Returns an array that has been padded to a specified shape with a padding value at the top-left corner.

MLXBackend.transpose(arr)

Compute the transpose of arr.

MLXBackend.tril_indices(*args, **kwargs)

Compute indices of upper triangular matrix

MLXBackend.unique(*args, **kwargs)

Find the unique elements of an array.

MLXBackend.unravel_index(indices, shape)

Convert flat index to array indices.

MLXBackend.where(*args, **kwargs)

Return elements from input depending on condition.

MLXBackend.zeros(shape[, dtype])

Returns an aligned array of zeros with specified shape and dtype.