Skip to content

Conversation

@okakarpa
Copy link
Collaborator

Cherry-pick of #2340

Cast numpy dtype result to torch dtype result before compare

Numpy returns `np.power(float32, int64) => float64` [Promotion rules for
Python scalars](https://numpy.org/neps/nep-0050-scalar-promotion.html)
Pytorch returns `torch.pow(float32, int64) => float32`

Reverts #2287 and fixes tests in a
different way

Fixes:
- SWDEV-538110 - `'dtype' do not match: torch.float32 != torch.float64`
> -
test_binary_ufuncs.py::TestBinaryUfuncsCUDA::test_cuda_tensor_pow_scalar_tensor_cuda
- SWDEV-539171 - `AttributeError: 'float' object has no attribute
'dtype`
> -
test_binary_ufuncs.py::TestBinaryUfuncsCUDA::test_long_tensor_pow_floats_cuda
> -
test_binary_ufuncs.py::TestBinaryUfuncsCUDA::test_complex_scalar_pow_tensor_cuda_*
> -
test_binary_ufuncs.py::TestBinaryUfuncsCUDA::test_float_scalar_pow_float_tensor_cuda_*
@ethanwee1 ethanwee1 marked this pull request as ready for review July 14, 2025 19:03
@rocm-repo-management-api
Copy link

rocm-repo-management-api bot commented Jul 14, 2025

Jenkins build for baa35b291f15a3002b2859a5964a2bf70169f199 commit finished as FAILURE
Links: Blue Ocean view / Build artifacts

@pruthvistony pruthvistony merged commit ef94e43 into rocm7.0_internal_testing Jul 15, 2025
0 of 5 checks passed
@pruthvistony pruthvistony deleted the autogenerated/rocm7.0_internal_testing_cherry-pick_pr-2340 branch July 15, 2025 16:54
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