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

Remove in-place operations #2263

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Conversation

beat-buesser
Copy link
Collaborator

Description

This pull request removes in-place operations that overwrite the input data.

Fixes #2262

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Signed-off-by: Beat Buesser <beat.buesser@ibm.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2023

Codecov Report

Merging #2263 (52f64a8) into dev_1.15.2 (8d9de16) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Impacted file tree graph

@@             Coverage Diff             @@
##           dev_1.15.2    #2263   +/-   ##
===========================================
  Coverage       85.62%   85.62%           
===========================================
  Files             308      308           
  Lines           27476    27476           
  Branches         5048     5048           
===========================================
  Hits            23526    23526           
  Misses           2669     2669           
  Partials         1281     1281           
Files Changed Coverage Δ
...mators/object_detection/pytorch_object_detector.py 84.65% <100.00%> (ø)
art/estimators/object_detection/pytorch_yolo.py 82.48% <100.00%> (ø)

Copy link
Collaborator

@f4str f4str left a comment

Choose a reason for hiding this comment

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

Hi @beat-buesser thank you fixing this issue! I've tested it with the attack_adversarial_patch_pytorch_yolo.ipynb demo notebook and it is working once again without issues.

One minor comment that the change in translate_predictions_xcycwh_to_x1y1x2y2 is not needed, but functionality-wise its the same. Feel free to keep the change or revert it back.

Comment on lines +106 to +107
labels[:, 2:6:2] = labels[:, 2:6:2] / width
labels[:, 3:6:2] = labels[:, 3:6:2] / height
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't necessary since labels is a newly created tensor. But the functionality is still the same.

@beat-buesser beat-buesser self-assigned this Sep 1, 2023
@beat-buesser beat-buesser added bug Something isn't working improvement Improve implementation labels Sep 1, 2023
@beat-buesser beat-buesser added this to Pull request open in ART 1.15.2 via automation Sep 1, 2023
@beat-buesser beat-buesser added this to the ART 1.15.2 milestone Sep 1, 2023
@beat-buesser beat-buesser merged commit ad0a546 into dev_1.15.2 Sep 1, 2023
71 checks passed
ART 1.15.2 automation moved this from Pull request open to Pull request done Sep 1, 2023
@beat-buesser beat-buesser deleted the development_issue_2262_2 branch September 1, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement Improve implementation
Projects
No open projects
ART 1.15.2
Pull request done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants