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

Fix LeakyRelu behaviour on empty input (#18934) #18996

Merged
merged 2 commits into from
Aug 24, 2020
Merged

Conversation

bgawrych
Copy link
Contributor

@bgawrych bgawrych commented Aug 24, 2020

Description

fix #18934

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • 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)
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Comments

In numpy mode everything works fine.
NDArray mode throws:

  File "leaky.py", line 5, in <module>
    b = mx.ndarray.LeakyReLU(input)
  File "<string>", line 72, in LeakyReLU
  File "/home/wihajster/Desktop/incubator-mxnet/python/mxnet/_ctypes/ndarray.py", line 82, in _imperative_invoke
    check_call(_LIB.MXImperativeInvokeEx(
  File "/home/wihajster/Desktop/incubator-mxnet/python/mxnet/base.py", line 246, in check_call
    raise get_last_ffi_error()
mxnet.base.MXNetError: Traceback (most recent call last):
  File "../src/imperative/imperative.cc", line 678
MXNetError: Check failed: shape_is_known(arr.shape()):

I think this is correct behavior, as legacy mode doesn’t let empty arrays.

@mxnet-bot
Copy link

Hey @bgawrych , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with 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-gpu, website, centos-cpu, clang, unix-cpu, centos-gpu, unix-gpu, windows-cpu, sanity, miscellaneous, edge]


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.

@szha szha requested a review from TaoLv August 24, 2020 06:57
@leezu leezu merged commit 3c4ac19 into apache:master Aug 24, 2020
@szha
Copy link
Member

szha commented Aug 25, 2020

thanks for the fix! @bgawrych

chinakook pushed a commit to chinakook/mxnet that referenced this pull request Nov 17, 2020
* Fix LeakyRelu behaviour on empty input

* Remove duplicated declarations
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.

Floating point exception in mxnet.ndarray.LeakyReLU
5 participants