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

fix full and full_like when input is boolean #17668

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

Alicia1529
Copy link
Contributor

Description

  1. enable np.full to accept Boolean values as fill_value
>>> from mxnet import np
>>> np.full((3,3), True)
array([[ True,  True,  True],
       [ True,  True,  True],
       [ True,  True,  True]])
>>> np.full((3,3), False, dtype=np.int32)
array([[0, 0, 0],
       [0, 0, 0],
       [0, 0, 0]], dtype=int32)
  1. enable np.full_like to accept 'np.bool' as dtype and boolean values as 'fill_value'
>>> a = np.arange(9).reshape(3,3)
>>> np.full_like(a, 1, dtype=np.bool)
array([[ True,  True,  True],
       [ True,  True,  True],
       [ True,  True,  True]])
>>> np.full_like(a, False)
array([[0., 0., 0.],
       [0., 0., 0.],
       [0., 0., 0.]])

@haojin2 haojin2 added the Numpy label Feb 25, 2020
@haojin2 haojin2 self-assigned this Feb 25, 2020
@haojin2 haojin2 added this to In progress in numpy via automation Feb 25, 2020
Copy link
Contributor

@haojin2 haojin2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

numpy automation moved this from In progress to Reviewer approved Feb 25, 2020
@haojin2 haojin2 merged commit c63ae49 into apache:master Feb 26, 2020
numpy automation moved this from Reviewer approved to Done Feb 26, 2020
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
numpy
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants