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

Canonical type comparison #2492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

AryazE
Copy link

@AryazE AryazE commented Sep 10, 2024

Description

In Numpy

import numpy as np
a = np.array([1.1, 2.2])
print(a.dtype) # dtype('float64')
print(a.dtype == None) # True

Therefore, comparisons of dtypes should be done with is. It is also the canonical way of exact type comparison in Python.

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

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • Test A
  • Test B

Test Configuration:

  • OS
  • Python version
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet version

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My changes have been tested using both CPU and GPU devices

Signed-off-by: Aryaz Eghbali <[email protected]>
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.42%. Comparing base (2f62c14) to head (7d5950b).

Files with missing lines Patch % Lines
art/attacks/evasion/fast_gradient.py 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2492      +/-   ##
==========================================
- Coverage   85.24%   84.42%   -0.83%     
==========================================
  Files         329      329              
  Lines       30143    30143              
  Branches     5173     5173              
==========================================
- Hits        25696    25447     -249     
- Misses       3019     3284     +265     
+ Partials     1428     1412      -16     
Files with missing lines Coverage Δ
art/estimators/tensorflow.py 78.00% <100.00%> (ø)
art/attacks/evasion/fast_gradient.py 86.01% <0.00%> (ø)

... and 3 files with indirect coverage changes

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.

2 participants