Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test for Numba Func #2893

Merged
merged 4 commits into from
Apr 22, 2021
Merged

Conversation

majra20
Copy link
Contributor

@majra20 majra20 commented Apr 22, 2021

Why we need this PR?

  • It fixes a bug: Data passed in test_operator_numba_func:test_multiple_ins has wrong shape. It shows that we should make additional checks if user populated data correctly.

What happened in this PR?

  • What solution was applied:
    [ Passed correct data to test and add checks if data passed by user is in same shape that user expects ]
  • Affected modules and functionalities:
    [ Additional checks in numba_func.cc ]
  • Key points relevant for the review:
    [ NA ]
  • Validation and testing:
    [ NA ]
  • Documentation (including examples):
    [ NA ]

Rafal Maj added 2 commits April 22, 2021 10:16
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
dali/operators/numba_function/numba_func.cc Outdated Show resolved Hide resolved
dali/operators/numba_function/numba_func.cc Outdated Show resolved Hide resolved
@jantonguirao jantonguirao self-assigned this Apr 22, 2021
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
@majra20
Copy link
Contributor Author

majra20 commented Apr 22, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2294233]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2294233]: BUILD PASSED

def test_multiple_ins():
pipe = numba_multiple_ins_pipe(shapes=(10, 10), dtype=np.uint8, batch_size=8, num_threads=1, device_id=0, run_fn=multiple_ins_run, setup_fn=multiple_ins_setup,
pipe = numba_multiple_ins_pipe(shapes=[(10, 10)], dtype=np.uint8, batch_size=8, num_threads=1, device_id=0, run_fn=multiple_ins_run, setup_fn=multiple_ins_setup,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the fix?

Copy link
Contributor Author

@majra20 majra20 Apr 22, 2021

Choose a reason for hiding this comment

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

Yes, that fixes test. I populated data in wrong way. That's why I added additional checks basing on what data type user pass and what user expect.

Fix for dead ptr is adding out_shapes_ member variable and holding pointers to it.

Signed-off-by: Rafal Maj <rmaj@nvidia.com>
@majra20
Copy link
Contributor Author

majra20 commented Apr 22, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2294485]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2294485]: BUILD PASSED

@majra20 majra20 merged commit 5cb0bd6 into NVIDIA:master Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants