-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
feat(numpy backend): removed manual dtype casting. #23681
feat(numpy backend): removed manual dtype casting. #23681
Conversation
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.
PR Compliance Checks
Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.
Issue Reference
In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our contributing guide and our PR template.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.
@@ -428,13 +428,6 @@ def cummax( | |||
dtype: Optional[np.dtype] = None, | |||
out: Optional[np.ndarray] = None, | |||
) -> Tuple[np.ndarray, np.ndarray]: |
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.
result of running the script on cummax
:
int8 (array([1, 1, 1], dtype=int8), array([0, 1, 2], dtype=int64))
int16 (array([1, 1, 1], dtype=int16), array([0, 1, 2], dtype=int64))
int32 (array([1, 1, 1]), array([0, 1, 2], dtype=int64))
int64 (array([1, 1, 1], dtype=int64), array([0, 1, 2], dtype=int64))
uint8 (array([1, 1, 1], dtype=uint8), array([0, 1, 2], dtype=int64))
uint16 (array([1, 1, 1], dtype=uint16), array([0, 1, 2], dtype=int64))
uint32 (array([1, 1, 1], dtype=uint32), array([0, 1, 2], dtype=int64))
uint64 (array([1, 1, 1], dtype=uint64), array([0, 1, 2], dtype=int64))
float16 (array([1., 1., 1.], dtype=float16), array([0, 1, 2], dtype=int64))
float32 (array([1., 1., 1.], dtype=float32), array([0, 1, 2], dtype=int64))
float64 (array([1., 1., 1.]), array([0, 1, 2], dtype=int64))
complex64 (array([1.+0.j, 1.+0.j, 1.+0.j], dtype=complex64), array([0, 1, 2], dtype=int64))
complex128 (array([1.+0.j, 1.+0.j, 1.+0.j]), array([0, 1, 2], dtype=int64))
bool (array([ True, True, True]), array([0, 1, 2], dtype=int64))
Supported Data Types:
@with_supported_dtypes(
{"1.25.2 and below": ('bool', 'complex128', 'complex64', 'float16', 'float32', 'float64', 'int16', 'int32', 'int64', 'int8', 'uint16', 'uint32', 'uint64', 'uint8')}, backend_version
)
Unsupported Data Types:
@with_unsupported_dtypes(
{"1.25.2 and below": ()}, backend_version
)
@@ -527,10 +520,7 @@ def cummin( | |||
out: Optional[np.ndarray] = None, | |||
) -> np.ndarray: | |||
if dtype is None: |
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.
same for cummin
int8 [1 1 1]
int16 [1 1 1]
int32 [1 1 1]
int64 [1 1 1]
uint8 [1 1 1]
uint16 [1 1 1]
uint32 [1 1 1]
uint64 [1 1 1]
float16 [1. 1. 1.]
float32 [1. 1. 1.]
float64 [1. 1. 1.]
complex64 [1.+0.j 1.+0.j 1.+0.j]
complex128 [1.+0.j 1.+0.j 1.+0.j]
bool [ True True True]
Supported Data Types:
@with_supported_dtypes(
{"1.25.2 and below": ('bool', 'complex128', 'complex64', 'float16', 'float32', 'float64', 'int16', 'int32', 'int64', 'int8', 'uint16', 'uint32', 'uint64', 'uint8')}, backend_version
)
Unsupported Data Types:
@with_unsupported_dtypes(
{"1.25.2 and below": ()}, backend_version
)
@@ -171,7 +171,7 @@ def var( | |||
# ------# | |||
|
|||
|
|||
@with_unsupported_dtypes({"1.25.2 and below": "bfloat16"}, backend_version) |
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.
int8 [1 2 6]
int16 [1 2 6]
int32 [1 2 6]
int64 [1 2 6]
uint8 [1 2 6]
uint16 [1 2 6]
uint32 [1 2 6]
uint64 [1 2 6]
float16 [1. 2. 6.]
float32 [1. 2. 6.]
float64 [1. 2. 6.]
complex64 [1.+0.j 2.+0.j 6.+0.j]
complex128 [1.+0.j 2.+0.j 6.+0.j]
bool [ True True True]
Supported Data Types:
@with_supported_dtypes(
{"1.25.2 and below": ('bool', 'complex128', 'complex64', 'float16', 'float32', 'float64', 'int16', 'int32', 'int64', 'int8', 'uint16', 'uint32', 'uint64', 'uint8')}, backend_version
)
Unsupported Data Types:
@with_unsupported_dtypes(
{"1.25.2 and below": ()}, backend_version
)
@@ -218,10 +215,6 @@ def cumsum( | |||
out: Optional[np.ndarray] = None, | |||
) -> np.ndarray: | |||
if dtype is None: | |||
if x.dtype == "bool": |
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.
int8 [1 3 6]
int16 [1 3 6]
int32 [1 3 6]
int64 [1 3 6]
uint8 [1 3 6]
uint16 [1 3 6]
uint32 [1 3 6]
uint64 [1 3 6]
float16 [1. 3. 6.]
float32 [1. 3. 6.]
float64 [1. 3. 6.]
complex64 [1.+0.j 3.+0.j 6.+0.j]
complex128 [1.+0.j 3.+0.j 6.+0.j]
bool [ True True True]
Supported Data Types:
@with_supported_dtypes(
{"1.25.2 and below": ('bool', 'complex128', 'complex64', 'float16', 'float32', 'float64', 'int16', 'int32', 'int64', 'int8', 'uint16', 'uint32', 'uint64', 'uint8')}, backend_version
)
Unsupported Data Types:
@with_unsupported_dtypes(
{"1.25.2 and below": ()}, backend_version
)
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! Feel free to merge, thanks @Madjid-CH 😄
(I'm assuming you've already run the tests for the functions changed and the tests pass or fail, whichever was the state of those tests before the changes. And even if it fails, the logs of the failure are the same as those before making the changes.)
yeah, the tests was failing because of a missing |
PR Description
used script for dtypes checking: