modules Package

modules Package

builtinmodule Module

Type functions for Python builtins.

numba.type_inference.modules.builtinmodule.abs_(typesystem, node, x)
numba.type_inference.modules.builtinmodule.abstype(argtype)
numba.type_inference.modules.builtinmodule.cast(node, dst_type)
numba.type_inference.modules.builtinmodule.complex_(typesystem, node, a, b)
numba.type_inference.modules.builtinmodule.globals_(typesystem, node)
numba.type_inference.modules.builtinmodule.len_(typesystem, node, obj)
numba.type_inference.modules.builtinmodule.locals_(typesystem, node)
numba.type_inference.modules.builtinmodule.pow_(typesystem, node, base, exponent, mod)
numba.type_inference.modules.builtinmodule.range_(typesystem, node, start, stop, step)
numba.type_inference.modules.builtinmodule.round_(typesystem, node, number, ndigits)
numba.type_inference.modules.builtinmodule.xrange_(typesystem, node, start, stop, step)

mathmodule Module

Resolve calls to math functions.

During type inference this annotates math calls, and during final specialization it produces LLVMIntrinsicNode and MathCallNode nodes.

numba.type_inference.modules.mathmodule.abs_(typesystem, node, x)
numba.type_inference.modules.mathmodule.binop_type(typesystem, x, y)

Binary result type for math operations

numba.type_inference.modules.mathmodule.id_name(x)
numba.type_inference.modules.mathmodule.infer_cmath_call(typesystem, call_node, *args)

Resolve calls to llvmmath math calls

numba.type_inference.modules.mathmodule.infer_math_call(typesystem, call_node, *args)

Resolve calls to llvmmath math calls

numba.type_inference.modules.mathmodule.mk_infer_math_call(default_result_type)
numba.type_inference.modules.mathmodule.npy_name(name)
numba.type_inference.modules.mathmodule.pow_(typesystem, call_node, node, power, mod=None)
numba.type_inference.modules.mathmodule.reg(mod, register, getname)
numba.type_inference.modules.mathmodule.register_math(infer_math_call, nargs, value)

numbamodule Module

numba.type_inference.modules.numbamodule.typeof(expr_type)

numpymodule Module

Infer types for NumPy functionality. This includes:

  1. Figuring out dtypes

    e.g. np.double -> double

    np.dtype(‘d’) -> double

  2. Function calls such as np.empty/np.empty_like/np.arange/etc

numba.type_inference.modules.numpymodule.arange(start, stop, step, dtype)

Resolve a call to np.arange()

numba.type_inference.modules.numpymodule.array(object, dtype, order, subok)
numba.type_inference.modules.numpymodule.array_from_object(a)

object -> array type:

array_from_object(ASTNode([[1, 2], [3, 4]])) => int64[:, :]

numba.type_inference.modules.numpymodule.array_from_type(type)
numba.type_inference.modules.numpymodule.cholesky(typesystem, a)
numba.type_inference.modules.numpymodule.cond(typesystem, x, p)
numba.type_inference.modules.numpymodule.demote_to_scalar(type)

Demote 0d arrays to scalars

numba.type_inference.modules.numpymodule.det(typesystem, a)
numba.type_inference.modules.numpymodule.dot(typesystem, a, b, out)

Resolve a call to np.dot()

numba.type_inference.modules.numpymodule.dtype(obj, align)

Parse np.dtype(...) calls

numba.type_inference.modules.numpymodule.eig(typesystem, a)
numba.type_inference.modules.numpymodule.eigh(typesystem, a, UPLO)
numba.type_inference.modules.numpymodule.eigvals(typesystem, a)
numba.type_inference.modules.numpymodule.eigvalsh(typesystem, a, UPLO)
numba.type_inference.modules.numpymodule.einsum(typesystem, subs, operands, kws)
numba.type_inference.modules.numpymodule.empty(shape, dtype, order)
numba.type_inference.modules.numpymodule.empty_like(a, dtype, order)

Parse the result type for np.empty_like calls

numba.type_inference.modules.numpymodule.get_dtype(dtype_arg, default_dtype=None)

Simple helper function to map an AST node dtype keyword argument => NumPy dtype. ‘

numba.type_inference.modules.numpymodule.inner(typesystem, a, b)
numba.type_inference.modules.numpymodule.inv(typesystem, a)
numba.type_inference.modules.numpymodule.kron(typesystem, a, b)
numba.type_inference.modules.numpymodule.lstsq(typesystem, a, b, rcond)
numba.type_inference.modules.numpymodule.matrix_power(typesystem, M, n)
numba.type_inference.modules.numpymodule.matrix_rank(typesystem, M, tol)
numba.type_inference.modules.numpymodule.nonzero(a)
numba.type_inference.modules.numpymodule.norm(typesystem, x, ord)
numba.type_inference.modules.numpymodule.outer(typesystem, a, b)
numba.type_inference.modules.numpymodule.pinv(typesystem, a, rcond)
numba.type_inference.modules.numpymodule.promote(typesystem, *types)
numba.type_inference.modules.numpymodule.promote_to_array(dtype)

Promote scalar to 0d array type

numba.type_inference.modules.numpymodule.qr(typesystem, a, mode)
numba.type_inference.modules.numpymodule.resolve_attribute_dtype(dtype, default=None)

Resolve the type for numpy dtype attributes

numba.type_inference.modules.numpymodule.slogdet(typesystem, a)
numba.type_inference.modules.numpymodule.solve(typesystem, a, b)
numba.type_inference.modules.numpymodule.svd(typesystem, a, full_matrices, compute_uv)
numba.type_inference.modules.numpymodule.tensordot(typesystem, a, b, axes)

Typing function for numpy.tensordot().

Defaults to Python object for any caller that isn’t using the default argument to axes.

Otherwise, it is similar to inner(), but subtracts four dimensions from the result instead of two.

Without symbolic execution of the actual axes argument, this can’t determine the number of axes to sum over, so it punts. This typing function could use an array type of unknown dimensionality, were one available. See: https://www.pivotaltracker.com/story/show/43687249

numba.type_inference.modules.numpymodule.tensorinv(typesystem, a, ind)
numba.type_inference.modules.numpymodule.tensorsolve(typesystem, a, b, axes)
numba.type_inference.modules.numpymodule.trace(typesystem, a, offset, axis1, axis2, dtype, out)
numba.type_inference.modules.numpymodule.vdot(typesystem, a, b)
numba.type_inference.modules.numpymodule.where(typesystem, condition, x, y)

numpyufuncs Module

Type inference for NumPy binary ufuncs and their methods.

class numba.type_inference.modules.numpyufuncs.UfuncTypeInferer(ufunc)

Bases: object

Infer types for arbitrary ufunc

infer(typesystem, argtypes)
numba.type_inference.modules.numpyufuncs.accumulate(a, axis, dtype, out, static_dtype=None)
numba.type_inference.modules.numpyufuncs.accumulate_bool(a, axis, dtype, out)
numba.type_inference.modules.numpyufuncs.array_of_dtype(a, dtype, static_dtype, out)
numba.type_inference.modules.numpyufuncs.binary_map(typesystem, a, b, out)
numba.type_inference.modules.numpyufuncs.binary_map_bool(typesystem, a, b, out)
numba.type_inference.modules.numpyufuncs.find_signature(args, signatures)
numba.type_inference.modules.numpyufuncs.find_ufunc_signature(typesystem, argtypes, signatures)
Map (float_, double) and [double(double, double),
int_(int_, int_), ...]

to double(double, double)

numba.type_inference.modules.numpyufuncs.numba_type_from_sig(ufunc_signature)

Convert ufunc type signature string (e.g. ‘dd->d’) to a function

numba.type_inference.modules.numpyufuncs.outer(typesystem, a, b, static_dtype=None)
numba.type_inference.modules.numpyufuncs.outer_bool(typesystem, a, b)
numba.type_inference.modules.numpyufuncs.reduce_(a, axis, dtype, out, static_dtype=None)
numba.type_inference.modules.numpyufuncs.reduce_bool(a, axis, dtype, out)
numba.type_inference.modules.numpyufuncs.reduceat(a, indices, axis, dtype, out, static_dtype=None)
numba.type_inference.modules.numpyufuncs.reduceat_bool(a, indices, axis, dtype, out)
numba.type_inference.modules.numpyufuncs.register_arbitrary_ufunc(ufunc)

Type inference for arbitrary ufuncs

numba.type_inference.modules.numpyufuncs.register_arithmetic_ufunc(register_inferer, register_unbound, binary_ufunc)
numba.type_inference.modules.numpyufuncs.register_bool_ufunc(register_inferer, register_unbound, binary_ufunc)

utils Module

numba.type_inference.modules.utils.expect_n_args(node, name, nargs)
numba.type_inference.modules.utils.register_with_argchecking(nargs, can_handle_deferred_types=False)