Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix flaky test: boolean index and fix bugs #17222

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

Alicia1529
Copy link
Contributor

  1. fix the problem in issue Flaky test: test_numpy_op.test_npi_boolean_assign #17219:
    As the variable val is a mxnet.numpy.array, the operation np_data[np_mask] = val actually fall back to mxnet operation
  2. handle boolean indexing on 0-d array and index as primitive boolean type. For example:
>>> from mxnet import np, npx
>>> npx.set_np()
>>> import numpy as _np
>>> mx_a = np.array(1)
>>> np_a = _np.array(1)
>>> mx_a[True]
array([1.])
>>> mx_a[False]
array([])
>>> np_a[True]
array([1])
>>> np_a[False]
array([], dtype=int64)

@Alicia1529 Alicia1529 requested a review from szha as a code owner January 6, 2020 08:40
@haojin2 haojin2 merged commit 52f3bba into apache:master Jan 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants