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

[Numpy] allow mix integer dtypes for power/add/multiply #17921

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

JiangZhaoh
Copy link
Contributor

@JiangZhaoh JiangZhaoh commented Mar 27, 2020

Description

resolution for issue #17839
allow to mix bool\int8\int32\int64 for add\multiply\power
Examples:

import mxnet as mx
from mxnet import numpy as np
mx.npx.set_np()
a = np.ones((10,), dtype=mx.np.int32)
b = np.ones((10,), dtype=mx.np.int64)
c = a * b
c
c = a + b
c
c = np.power(a, b)
c

Print:

array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=int64)
array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2], dtype=int64)
array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=int64)

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@mxnet-bot
Copy link

Hey @JiangZhaoh , Thanks for submitting the PR
Once your PR is ready for CI checks, invoke the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [windows-cpu, unix-gpu, centos-gpu, edge, website, windows-gpu, unix-cpu, clang, centos-cpu, sanity, miscellaneous]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@haojin2 haojin2 self-assigned this Mar 31, 2020
@haojin2 haojin2 added the Numpy label Mar 31, 2020
@haojin2 haojin2 added this to In progress in numpy via automation Mar 31, 2020
@JiangZhaoh
Copy link
Contributor Author

@mxnet-bot run ci [unix-gpu]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [unix-gpu]

@JiangZhaoh
Copy link
Contributor Author

@mxnet-bot run ci [unix-gpu]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [unix-gpu]

@haojin2 haojin2 merged commit d97dead into apache:master Apr 8, 2020
numpy automation moved this from In progress to Done Apr 8, 2020
sxjscience pushed a commit to sxjscience/mxnet that referenced this pull request Jul 1, 2020
* resolution

* fix sanity error

* remove func 'is_integer'
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

3 participants