Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt the numpy.array_api module as cupy.array_api #5698

Merged
merged 165 commits into from
Sep 27, 2021

Commits on Sep 5, 2021

  1. Add initial array_api sub-namespace

    This is based on the function stubs from the array API test suite, and is
    currently based on the assumption that NumPy already follows the array API
    standard. Now it needs to be modified to fix it in the places where NumPy
    deviates (for example, different function names for inverse trigonometric
    functions).
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    f290297 View commit details
    Browse the repository at this point in the history
  2. Add dtypes to the _array_api namespace

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    6e0b163 View commit details
    Browse the repository at this point in the history
  3. Fix array API functions that are named differently or not in the defa…

    …ult numpy namespace
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    bc6cd91 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0d2f35d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2a9765a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    94980e5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7940635 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a45d744 View commit details
    Browse the repository at this point in the history
  9. Make the array_api submodules private, and remove __all__ from indivi…

    …dual files
    
    The specific submodule organization is an implementation detail and should not
    be used. Only the top-level numpy._array_api namespace should be used.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    5d602a5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5dfd723 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1587e46 View commit details
    Browse the repository at this point in the history
  12. Use "import numpy as np" in the array_api submodule

    This avoids importing everything inside the individual functions, but still is
    preferred over importing the functions used explicitly, as most of them clash
    with the wrapper function names.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    dad5148 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    58140bc View commit details
    Browse the repository at this point in the history
  14. Add basic docstrings to the array API wrapper functions

    The docstrings just point back to the functions they wrap for now. More
    thought may need to be put into this for the future. Most functions can
    actually perhaps inherit the docstring of the function they wrap directly, but
    there are some functions that have differences (e.g., different names,
    different keyword arguments, fewer keyword arguments, etc.). There's also the
    question of how to handle cross-references/see alsos that point to functions
    not in the API spec and behavior shown in docstring examples that isn't
    required in the spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    f2f5039 View commit details
    Browse the repository at this point in the history
  15. Add an explanatory docstring to _array_api/__init__.py

    This is mostly aimed at any potential reviewers of the module for now.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    0da4b09 View commit details
    Browse the repository at this point in the history
  16. Add type annotations to the array api submodule function definitions

    Some stubs still need to be modified to properly pass mypy type checking.
    Also, 'device' is just left as a TypeVar() for now.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    adefed2 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    d2c4fcf View commit details
    Browse the repository at this point in the history
  18. Use np.asarray in the array API submodule for any function that can r…

    …eturn a scalar
    
    This is needed to pass mypy type checks for the given type annotations.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    70155e6 View commit details
    Browse the repository at this point in the history
  19. Use _implementation on all functions that have it in the array API su…

    …bmodule
    
    That way they only work on actual ndarray inputs, not array-like, which is
    more inline with the spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    76eb888 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    9639de2 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    9c2f8b8 View commit details
    Browse the repository at this point in the history
  22. Start implementing wrapper object for the array API

    So far, it just is a wrapper with all the methods defined in the spec, which
    all pass through. The next step is to make it so that the methods that behave
    differently actually work as the spec describes. We also still need to modify
    all the array_api functions to return this wrapper object instead of
    np.ndarray.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    d185d4b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    e1ff4f9 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    0d7999a View commit details
    Browse the repository at this point in the history
  25. Implement a simple passthrough __str__ and __repr__ on the array_api …

    …ndarray class
    
    These methods aren't required by the spec, but without them, the array object
    is harder to use interactively.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    19ecbe7 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    29f8cc2 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    1ae8959 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    89016b0 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    783595e View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    e71addb View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    e753072 View commit details
    Browse the repository at this point in the history
  32. Only allow the spec guaranteed dtypes in the array API elementwise fu…

    …nctions
    
    The array API namespace is designed to be only those parts of specification
    that are required. So many things that work in NumPy but are not required by
    the array API specification will not work in the array_api namespace
    functions. For example, transcendental functions will only work with
    floating-point dtypes, because those are the only dtypes required to work by
    the array API specification.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    26c6348 View commit details
    Browse the repository at this point in the history
  33. Make an error message easier to read

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    5463790 View commit details
    Browse the repository at this point in the history
  34. Don't check if a dtype is in all_dtypes

    The array API namespace is not going to do type checking against arbitrary
    objects. An object that takes an array as input should assume that it will get
    an array API namespace array object. Passing a NumPy array or other type of
    object to any of the functions is undefined behavior, unless the type
    signature allows for it.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    2e56f8e View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    0223975 View commit details
    Browse the repository at this point in the history
  36. Make the array API constants into dimension 0 arrays

    The spec does not actually specify whether these should be dimension 0 arrays
    or Python floats (which they are in NumPy). However, making them dimension 0
    arrays is cleaner, and ensures they also have all the methods and attributes
    that are implemented on the ndarray object.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    e6fa443 View commit details
    Browse the repository at this point in the history
  37. Clean up some imports

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    c09758c View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    2c63f78 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    e8055d1 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    cdef60d View commit details
    Browse the repository at this point in the history
  41. Remove _implementation from the array API functions

    As discussed at
    https://mail.python.org/pipermail/numpy-discussion/2021-February/081541.html,
    _implementation is not as useful for the array API module as previously
    thought.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    f523a11 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    bdb60bd View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    e0adef8 View commit details
    Browse the repository at this point in the history
  44. Only allow indices that are required by the spec in the array API nam…

    …espace
    
    The private function _validate_indices describes the cases that are
    disallowed. This functionality should be tested (it isn't yet), as the array
    API test suite will only test the cases that are allowed, not that
    non-required cases are rejected.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    d9df101 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    2151f10 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    73fb624 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    4154f92 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    da01464 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    b954e7e View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    f64447c View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    a085278 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    6e00aee View commit details
    Browse the repository at this point in the history
  53. Fix circular imports from types

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    1e0d72f View commit details
    Browse the repository at this point in the history
  54. bitwise_left_shift and bitwise_right_shift should return the dtype of…

    … the first argument
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    c48dc90 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    bdeb4ab View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    bac32a2 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    c0a330c View commit details
    Browse the repository at this point in the history
  58. Give a better error message in the array API asarray for out of bound…

    …s integers
    
    Without this the error message would be a confusing message about object
    arrays not being supported.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    8a38161 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    e629546 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    07b92f2 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    ffbe9c1 View commit details
    Browse the repository at this point in the history
  62. Use dtype objects instead of classes in the array API

    The array API does not require any methods or behaviors on dtype objects,
    other than that they be literals that can be compared for equality and passed
    to dtype keywords in functions. Since dtype objects are already used by the
    dtype attribute of ndarray, this makes it consistent, so that
    func(dtype=<dtype>).dtype will give exactly <dtype> back, which will be the
    same thing as numpy._array_api.<dtype>. This also fixes an issue in the array
    API test suite due to the fact that dtype classes and objects are not equal as
    dictionary keys.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    936db17 View commit details
    Browse the repository at this point in the history
  63. Fix type promotion consistency for the array API elementwise function…

    …s and operators
    
    NumPy's type promotion behavior deviates from the spec, which says that type
    promotion should work independently of shapes or values, in cases where one
    array is 0-d and the other is not. A helper function is added that works
    around this issue by adding a dimension to the 0-d array before passing it to
    the NumPy function. This function is used in elementwise functions and
    operators. It may still need to be applied to other functions in the
    namespace.
    
    Additionally, this fixes:
    
    - The shift operators (<< and >>) should always return the same dtype as the
      first argument.
    - NumPy's __pow__ does not type promote the two arguments, so we use the array
      API pow() in ndarray.__pow__, which does.
    - The internal _promote_scalar helper function was changed to return an array
      API ndarray object, as this is simpler with the inclusion of the new
      _normalize_two_args helper in the operators.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    a26de3b View commit details
    Browse the repository at this point in the history
  64. Add meshgrid(), broadcast_arrays(), broadcast_to(), and can_cast() to…

    … the array API namespace
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    e33d630 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    674dbdd View commit details
    Browse the repository at this point in the history
  66. Fix some error messages

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    b439d70 View commit details
    Browse the repository at this point in the history
  67. Fix the array API norm() function

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    c71899b View commit details
    Browse the repository at this point in the history
  68. Fix array API squeeze() and stack()

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    b543e3d View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    5e9fda2 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    66d9a39 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    1a1ddf8 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    c94883a View commit details
    Browse the repository at this point in the history
  73. Update the linear algebra functions in the array API namespace

    For now, only the functions in from the main spec namespace are implemented.
    The remaining linear algebra functions are part of an extension in the spec,
    and will be implemented in a future pull request. This is because the linear
    algebra functions are relatively complicated, so they will be easier to
    review separately.
    
    This also updates those functions that do remain for now to be more compliant
    with the spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    bbd6b04 View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    2af28f4 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    3eb5d22 View commit details
    Browse the repository at this point in the history
  76. Capitalize the names of the type hint types in the array API

    That way they aren't ambiguous with the attributes with the same names.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    0c13a3e View commit details
    Browse the repository at this point in the history
  77. Rename the array class in the array API namespace from ndarray to Array

    The actual class name doesn't matter because it isn't part of the namespace
    API (arrays should be constructed with the array creation functions like
    asarray()). However, it is better to use a name that is different from the
    existing NumPy array object to avoid ambiguity.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    9e232ff View commit details
    Browse the repository at this point in the history
  78. Configuration menu
    Copy the full SHA
    797150c View commit details
    Browse the repository at this point in the history
  79. Configuration menu
    Copy the full SHA
    285cc0b View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    a703bed View commit details
    Browse the repository at this point in the history
  81. Use better type signatures in the array API module

    This includes returning custom dataclasses for finfo and iinfo that only
    contain the properties required by the array API specification.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    994ce07 View commit details
    Browse the repository at this point in the history
  82. Small code cleanup

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    5026ed9 View commit details
    Browse the repository at this point in the history
  83. Configuration menu
    Copy the full SHA
    c38c6b8 View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    f5a2310 View commit details
    Browse the repository at this point in the history
  85. Update the type hints for the array API __pow__ and __truediv__

    They should not accept int. PEP 484 actually makes int a subtype of float, so
    this won't actually affect type checkers the way we would want.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    e89d82a View commit details
    Browse the repository at this point in the history
  86. Use tuples for internal type lists in the array API

    These are easier for type checkers to handle.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    0dda4e6 View commit details
    Browse the repository at this point in the history
  87. Fix some typing imports

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    a086d8c View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    3f46d66 View commit details
    Browse the repository at this point in the history
  89. Fix typo

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    207d779 View commit details
    Browse the repository at this point in the history
  90. Make the array API left and right shift do type promotion

    The spec previously said it should return the type of the left argument, but
    this was changed to do type promotion to be consistent with all the other
    elementwise functions/operators.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    783d157 View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    379b2ad View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    1ddbd5c View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    575e019 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    084b819 View commit details
    Browse the repository at this point in the history
  95. Remove error ignoring in the array API namespace

    The array API requires that elementwise functions always give a value, like
    nan. However, it doesn't specify that the functions need not give warnings. It
    is possible here to still break things by manually changing warnings into
    errors with np.seterr(), but this is considered unsupported behavior.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    330eac2 View commit details
    Browse the repository at this point in the history
  96. Fix some spelling errors

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    229a9b3 View commit details
    Browse the repository at this point in the history
  97. Configuration menu
    Copy the full SHA
    654ecf4 View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    9fdfac2 View commit details
    Browse the repository at this point in the history
  99. Configuration menu
    Copy the full SHA
    8d1ee76 View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    12129c8 View commit details
    Browse the repository at this point in the history
  101. Remove an unnecessary indexing

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    4e28c9e View commit details
    Browse the repository at this point in the history
  102. Configuration menu
    Copy the full SHA
    a96a571 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    bf2890f View commit details
    Browse the repository at this point in the history
  104. Start adding tests for the array API submodule

    The tests for the module will mostly focus on those things that aren't already
    tested by the official array API test suite
    (https://github.com/data-apis/array-api-tests). Currently, indexing tests are
    added, which test that the Array object correctly rejects otherwise valid
    indices that are not required by the array API spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    30778f7 View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    e688ea0 View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    ccbe442 View commit details
    Browse the repository at this point in the history
  107. Implement the array API result_type() manually

    np.result_type() has too many behaviors that we want to avoid in the array API
    namespace, like value-based casting and unwanted type promotions. Instead, we
    implement the exact type promotion table from the spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    29535ad View commit details
    Browse the repository at this point in the history
  108. Fix a typo in an error message

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    8f771de View commit details
    Browse the repository at this point in the history
  109. Restrict the array API namespace array operator type promotions

    Only those type promotions that are required by the spec are allowed. In
    particular, promotions across kinds, like integer + floating-point, are not
    allowed, except for the case of Python scalars.
    
    Tests are added for this.
    
    This commit additionally makes the operators return NotImplemented on
    unexpected input types rather than directly giving a TypeError. This is not
    strictly required by the array API spec, but it is generally considered a best
    practice for operator methods in Python.
    
    This same thing will be implemented for the various functions in the array API
    namespace in a later commit.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    b2c4246 View commit details
    Browse the repository at this point in the history
  110. Use ValueError instead of TypeError for array API @=

    This is consistent with @ and with NumPy.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    898e3d9 View commit details
    Browse the repository at this point in the history
  111. Configuration menu
    Copy the full SHA
    b82fcbc View commit details
    Browse the repository at this point in the history
  112. Configuration menu
    Copy the full SHA
    3e56849 View commit details
    Browse the repository at this point in the history
  113. Remove some dead code

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    8316e68 View commit details
    Browse the repository at this point in the history
  114. Configuration menu
    Copy the full SHA
    caf16dc View commit details
    Browse the repository at this point in the history
  115. Configuration menu
    Copy the full SHA
    5d62c00 View commit details
    Browse the repository at this point in the history
  116. Fix the array API trunc() to return the same dtype as the input

    It is similar to floor() and ceil() but I missed it previously.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    dab0e39 View commit details
    Browse the repository at this point in the history
  117. Fix the array API Array.__setitem__

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    75dba89 View commit details
    Browse the repository at this point in the history
  118. Configuration menu
    Copy the full SHA
    eebbc67 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    409e79b View commit details
    Browse the repository at this point in the history
  120. Only allow dtypes to be spelled with their names in the array API

    Other spellings like dtype=int or dtype='i' are not part of the spec.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    a0976d0 View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    0878800 View commit details
    Browse the repository at this point in the history
  122. Configuration menu
    Copy the full SHA
    866b5e5 View commit details
    Browse the repository at this point in the history
  123. Add a TODO comment

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    8f9955a View commit details
    Browse the repository at this point in the history
  124. Add tests for the array API creation functions

    As with the other array API tests, the tests primarily focus on things that
    should error. Working behavior is tested by the official array API test suite.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    694651a View commit details
    Browse the repository at this point in the history
  125. Rename numpy._array_api to numpy.array_api

    Instead of the leading underscore, the experimentalness of the module will be
    indicated by omitting a warning on import. That we, we do not have to change
    the API from underscore to no underscore when the module is no longer
    experimental.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    29de791 View commit details
    Browse the repository at this point in the history
  126. Configuration menu
    Copy the full SHA
    6b1684b View commit details
    Browse the repository at this point in the history
  127. Configuration menu
    Copy the full SHA
    46f568a View commit details
    Browse the repository at this point in the history
  128. Remove asarray() calls from the array API statistical functions

    asarray() is already called in Array._new.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    ac57827 View commit details
    Browse the repository at this point in the history
  129. Remove unused import

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    bb92224 View commit details
    Browse the repository at this point in the history
  130. Move the array API dtype categories into the top level

    They are not an official part of the spec but are useful for various parts of
    the implementation.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    61140a7 View commit details
    Browse the repository at this point in the history
  131. Move some imports out of functions to the top of the file

    Some of the imports in the array API module have to be inside functions to
    avoid circular imports, but these ones did not.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    cd31414 View commit details
    Browse the repository at this point in the history
  132. Configuration menu
    Copy the full SHA
    04be0e0 View commit details
    Browse the repository at this point in the history
  133. Configuration menu
    Copy the full SHA
    c69663a View commit details
    Browse the repository at this point in the history
  134. Configuration menu
    Copy the full SHA
    c7d5fd0 View commit details
    Browse the repository at this point in the history
  135. Configuration menu
    Copy the full SHA
    62cc871 View commit details
    Browse the repository at this point in the history
  136. Fix the array API __len__ method

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    becc418 View commit details
    Browse the repository at this point in the history
  137. Fix the array API unique() function

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    356891c View commit details
    Browse the repository at this point in the history
  138. Configuration menu
    Copy the full SHA
    dbcb237 View commit details
    Browse the repository at this point in the history
  139. Fix the array API nonzero() function

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    e080ea1 View commit details
    Browse the repository at this point in the history
  140. Configuration menu
    Copy the full SHA
    e55dc3c View commit details
    Browse the repository at this point in the history
  141. Run (selective) black on the array_api submodule

    I've omitted a few changes from black that messed up the readability of some
    complicated if statements that were organized logically line-by-line, and some
    changes that use unnecessary operator spacing.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    729b359 View commit details
    Browse the repository at this point in the history
  142. Configuration menu
    Copy the full SHA
    3a2dbc5 View commit details
    Browse the repository at this point in the history
  143. Add smallest_normal to the array API finfo

    This was blocked on #18536, which has been merged.
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    1114fa1 View commit details
    Browse the repository at this point in the history
  144. Remove Python 3.7 checks from the array API code

    NumPy has dropped Python 3.7, so these are no longer necessary (and they
    didn't completely work anyway).
    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    8692831 View commit details
    Browse the repository at this point in the history
  145. Add a release note entry for #18585

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    9febe14 View commit details
    Browse the repository at this point in the history
  146. Remove an unused import

    asmeurer authored and leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    fb93033 View commit details
    Browse the repository at this point in the history
  147. Configuration menu
    Copy the full SHA
    370c7db View commit details
    Browse the repository at this point in the history
  148. Configuration menu
    Copy the full SHA
    e3104ec View commit details
    Browse the repository at this point in the history
  149. Configuration menu
    Copy the full SHA
    c271454 View commit details
    Browse the repository at this point in the history
  150. remove irrelevant files

    leofang committed Sep 5, 2021
    Configuration menu
    Copy the full SHA
    5fecd61 View commit details
    Browse the repository at this point in the history
  151. Configuration menu
    Copy the full SHA
    d2a7803 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2021

  1. move numpy/array_api/tests to tests/cupyx_tests/array_api_tests

    - replace numpy/np by cupy/cp
    - make the tests runnable in CuPy's tester
    - comment out two failing tests (which I believe is OK)
    leofang committed Sep 6, 2021
    Configuration menu
    Copy the full SHA
    55e6a54 View commit details
    Browse the repository at this point in the history
  2. fix doc build

    leofang committed Sep 6, 2021
    Configuration menu
    Copy the full SHA
    d65bde2 View commit details
    Browse the repository at this point in the history
  3. more linter fixes...

    leofang committed Sep 6, 2021
    Configuration menu
    Copy the full SHA
    7972a88 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c70c449 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f154282 View commit details
    Browse the repository at this point in the history
  6. add device support

    leofang committed Sep 6, 2021
    Configuration menu
    Copy the full SHA
    03280a0 View commit details
    Browse the repository at this point in the history
  7. provide basic array api docs

    leofang committed Sep 6, 2021
    Configuration menu
    Copy the full SHA
    df769af View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3e9c65d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ce6d809 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2021

  1. build a skeleton for docs

    leofang committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    b81eb39 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2021

  1. expand docs

    leofang committed Sep 8, 2021
    Configuration menu
    Copy the full SHA
    d3a6f0d View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2021

  1. Configuration menu
    Copy the full SHA
    9e6f428 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05b7dd6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7e8191c View commit details
    Browse the repository at this point in the history