Skip to content

Conversation

@rraminen
Copy link

This PR is to cherry-pick test_torch.py changes from upstream 22d1359.

This fixes the below error:

_____________________________________________________________________________ TestTorch.test_tensor_with_grad_to_scalar_warning ______________________________________________________________________________
Traceback (most recent call last):
  File "/root/PR/pytorch/test/test_torch.py", line 10849, in test_tensor_with_grad_to_scalar_warning
    self.assertEqual(len(w), 1)
  File "/opt/venv/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 4114, in assertEqual
    raise error_metas.pop()[0].to_error(  # type: ignore[index]
AssertionError: Scalars are not equal!

Expected 1 but got 2.
Absolute difference: 1
Relative difference: 1.0

To execute this test, run the following from the base repo dir:
    python test/test_torch.py TestTorch.test_tensor_with_grad_to_scalar_warning

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

This fixes https://ontrack-internal.amd.com/browse/SWDEV-532432

@rraminen rraminen requested a review from pruthvistony July 18, 2025 07:38
@rocm-repo-management-api
Copy link

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

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

@rraminen rraminen requested a review from jithunnair-amd July 18, 2025 15:55
@pruthvistony pruthvistony merged commit 89423f3 into ROCm:rocm7.0_internal_testing Jul 18, 2025
0 of 5 checks passed
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