2018-11-17 18:03:33 -08:00
|
|
|
# Copyright 2018 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-06-03 14:18:48 -07:00
|
|
|
# flake8: noqa: F401
|
2018-12-11 12:44:02 -05:00
|
|
|
from . import fft
|
|
|
|
from . import linalg
|
2020-05-07 11:36:44 -04:00
|
|
|
|
|
|
|
from ..interpreters.xla import DeviceArray
|
|
|
|
|
|
|
|
from .lax_numpy import (
|
|
|
|
ComplexWarning, NINF, NZERO, PZERO, abs, absolute, add, all, allclose,
|
2020-09-16 13:30:08 -07:00
|
|
|
alltrue, amax, amin, angle, any, append,
|
|
|
|
apply_along_axis, apply_over_axes, arange, arccos, arccosh, arcsin,
|
2020-05-27 17:08:12 -07:00
|
|
|
arcsinh, arctan, arctan2, arctanh, argmax, argmin, argsort, argwhere, around,
|
2020-09-21 10:37:55 -07:00
|
|
|
array, array_equal, array_equiv, array_repr, array_split, array_str, asarray, atleast_1d, atleast_2d,
|
2020-05-07 13:17:43 -07:00
|
|
|
atleast_3d, average, bartlett, bfloat16, bincount, bitwise_and, bitwise_not,
|
2020-05-07 11:36:44 -04:00
|
|
|
bitwise_or, bitwise_xor, blackman, block, bool_, broadcast_arrays,
|
2020-10-02 13:13:21 -07:00
|
|
|
broadcast_to, can_cast, cbrt, cdouble, ceil, character, choose, clip, column_stack,
|
2020-05-27 18:57:00 -07:00
|
|
|
complex128, complex64, complex_, complexfloating, compress, concatenate,
|
|
|
|
conj, conjugate, convolve, copysign, corrcoef, correlate, cos, cosh,
|
2020-05-07 11:36:44 -04:00
|
|
|
count_nonzero, cov, cross, csingle, cumprod, cumproduct, cumsum, deg2rad,
|
2020-06-24 22:01:16 +05:30
|
|
|
degrees, diag, diagflat, diag_indices, diag_indices_from, diagonal, diff, digitize, divide, divmod, dot,
|
2020-05-09 05:36:09 -07:00
|
|
|
double, dsplit, dstack, dtype, e, ediff1d, einsum, einsum_path, empty,
|
2020-05-28 11:04:15 -07:00
|
|
|
empty_like, equal, euler_gamma, exp, exp2, expand_dims, expm1, extract, eye,
|
|
|
|
fabs, finfo, fix, flatnonzero, flexible, flip, fliplr, flipud, float16, float32,
|
2020-05-27 17:08:12 -07:00
|
|
|
float64, float_, float_power, floating, floor, floor_divide, fmax, fmin,
|
|
|
|
fmod, frexp, full, full_like, function, gcd, geomspace, gradient, greater,
|
2020-10-04 17:46:13 -04:00
|
|
|
greater_equal, hamming, hanning, heaviside, histogram, histogram_bin_edges, histogram2d, histogramdd,
|
2020-08-10 10:10:59 -07:00
|
|
|
hsplit, hstack, hypot, i0, identity, iinfo, imag,
|
2020-08-04 12:39:04 -07:00
|
|
|
indices, inexact, in1d, inf, inner, int16, int32, int64, int8, int_, integer,
|
2020-08-10 08:41:54 -07:00
|
|
|
interp, intersect1d, invert,
|
2020-05-19 16:58:42 -07:00
|
|
|
isclose, iscomplex, iscomplexobj, isfinite, isin, isinf, isnan, isneginf,
|
2020-05-11 10:22:49 -07:00
|
|
|
isposinf, isreal, isrealobj, isscalar, issubdtype, issubsctype, iterable,
|
2020-07-22 12:48:49 -07:00
|
|
|
ix_, kaiser, kron, lcm, ldexp, left_shift, less, less_equal, lexsort, linspace,
|
2020-05-11 10:22:49 -07:00
|
|
|
load, log, log10, log1p, log2, logaddexp, logaddexp2, logical_and,
|
|
|
|
logical_not, logical_or, logical_xor, logspace, mask_indices, matmul, max,
|
2020-07-29 12:53:28 -07:00
|
|
|
maximum, mean, median, meshgrid, min, minimum, mod, modf, moveaxis, msort,
|
2020-05-11 10:22:49 -07:00
|
|
|
multiply, nan, nan_to_num, nanargmax, nanargmin, nancumprod, nancumsum,
|
2020-06-24 18:16:45 +03:00
|
|
|
nanmedian, nanpercentile, nanquantile,
|
2020-05-11 10:22:49 -07:00
|
|
|
nanmax, nanmean, nanmin, nanprod, nanstd, nansum, nanvar, ndarray, ndim,
|
|
|
|
negative, newaxis, nextafter, nonzero, not_equal, number, numpy_version,
|
|
|
|
object_, ones, ones_like, operator_name, outer, packbits, pad, percentile,
|
2020-08-03 12:31:52 -07:00
|
|
|
pi, piecewise, polyadd, polyder, polymul, polysub, polyval, positive, power,
|
|
|
|
prod, product, promote_types, ptp, quantile,
|
2020-09-17 12:42:22 -07:00
|
|
|
rad2deg, radians, ravel, ravel_multi_index, real, reciprocal, remainder, repeat, reshape,
|
2020-05-11 10:22:49 -07:00
|
|
|
result_type, right_shift, rint, roll, rollaxis, rot90, round, row_stack,
|
|
|
|
save, savez, searchsorted, select, set_printoptions, shape, sign, signbit,
|
2020-07-28 02:57:36 +05:30
|
|
|
signedinteger, sin, sinc, single, sinh, size, sometrue, sort, sort_complex, split, sqrt,
|
2020-05-11 10:22:49 -07:00
|
|
|
square, squeeze, stack, std, subtract, sum, swapaxes, take, take_along_axis,
|
2020-06-11 02:57:35 +10:00
|
|
|
tan, tanh, tensordot, tile, trace, trapz, transpose, tri, tril, tril_indices, tril_indices_from,
|
2020-08-18 16:40:45 -04:00
|
|
|
trim_zeros, triu, triu_indices, triu_indices_from, true_divide, trunc, uint16, uint32, uint64, uint8, unique,
|
2020-06-24 15:22:35 +02:00
|
|
|
unpackbits, unravel_index, unsignedinteger, unwrap, vander, var, vdot, vsplit,
|
2020-07-09 16:31:08 -07:00
|
|
|
vstack, where, zeros, zeros_like, _NOT_IMPLEMENTED)
|
2020-05-07 11:36:44 -04:00
|
|
|
|
|
|
|
from .polynomial import roots
|
2020-02-12 14:09:37 -08:00
|
|
|
from .vectorize import vectorize
|
2020-05-07 11:36:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Module initialization is encapsulated in a function to avoid accidental
|
|
|
|
# namespace pollution.
|
|
|
|
def _init():
|
|
|
|
import numpy as np
|
|
|
|
from . import lax_numpy
|
|
|
|
from .. import util
|
|
|
|
# Builds a set of all unimplemented NumPy functions.
|
2020-07-08 14:44:49 -07:00
|
|
|
for name, func in util.get_module_functions(np).items():
|
|
|
|
if name not in globals():
|
2020-07-09 16:31:08 -07:00
|
|
|
_NOT_IMPLEMENTED.append(name)
|
2020-07-08 14:44:49 -07:00
|
|
|
globals()[name] = lax_numpy._not_implemented(func)
|
2020-05-07 11:36:44 -04:00
|
|
|
|
|
|
|
_init()
|
|
|
|
del _init
|