-
Notifications
You must be signed in to change notification settings - Fork 6.8k
set_lower_bound(1) so that stride is not zero #18997
Conversation
in issue: apache#18942, an error was occurring where strides became zero. to solve the issue, the lower bounds of stride1 and stride2 have been set to 1.
Hey @ekdnam , Thanks for submitting the PR
CI supported jobs: [windows-gpu, centos-gpu, unix-gpu, sanity, unix-cpu, clang, windows-cpu, edge, miscellaneous, website, centos-cpu] Note: |
'use_unifrom' changed to 'use_uniform'
What changes can I make to the source code so that the |
@ekdnam I think the test failed due to a network issue that's unrelated to the change. You can use the command as described by the mxnet ci bot in this comment: #18997 (comment). for now I triggered the retry for you. |
Thanks for the fix, @ekdnam! Could you add a test here and assert that proper error will happen when the parameter is out of bound? https://github.com/apache/incubator-mxnet/blob/3c4ac19daa3e645d918692b864ea19640f7e0314/tests/python/unittest/test_operator.py#L3200-L3233 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. once test is added it should be good to go!
Thanks for triggering the test! I will add the required unit tests. |
@szha can you give someone guidelines on the tests? I am sorta new to testing |
@ekdnam yes happy to help. As documented here, mxnet uses pytest as the python testing tool for development. Here's pytest's guide on how to write tests for expected exception. With that, you can write the statements to check whether an exception (and in this case the expected error should be To test this out locally, you need to:
|
Thanks a lot for such an in-depth answer!! |
checking that stride1 and stride2 are be greater than zero
@szha I am currently having some issues while building mxnet from source. It may take some more time to resolve them. So I can't test myself the changes made. Hope the changes made to |
@szha thanks for making the changes! :)) |
@mxnet-bot run ci [windows-gpu] |
Jenkins CI successfully triggered : [windows-gpu] |
@mxnet-bot run ci [windows-gpu] |
Jenkins CI successfully triggered : [windows-gpu] |
@ekdnam thanks for the fix! |
@szha sure! Thank you for the help! |
in issue: #18942, an error was occurring where strides became zero. to solve the issue, the lower bounds of stride1 and stride2 have been set to 1.
in issue: #18994, a typo was mentioned. that has also been cleared.
fix #18942
fix #18994
Description
(Brief description on what this PR is about)
When the correlation function is called on two arrays when the stride is zero, it results in a floating point exception as a division by zero is carried out. Thus, the lower bounds of stride1 and stride2 have been set to 1.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments