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 <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.62%. Comparing base (8d9de16) to head (52f64a8).
Report is 25 commits behind head on dev_1.15.2.

Additional details and impacted files

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           
Flag Coverage Δ
19.04% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines 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 the ART 1.15.2 milestone Sep 1, 2023
@beat-buesser beat-buesser merged commit ad0a546 into dev_1.15.2 Sep 1, 2023
@beat-buesser beat-buesser deleted the development_issue_2262_2 branch September 1, 2023 10:58
@beat-buesser beat-buesser restored the development_issue_2262_2 branch September 30, 2024 20:26
@beat-buesser beat-buesser deleted the development_issue_2262_2 branch October 1, 2024 15:56
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants