[Fix] Adding missing f prefixes to formatted strings [4/N] (#164068)

As stated in the title.

* __->__ #164068
* #164067
* #164066
* #164065

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164068
Approved by: https://github.com/Skylion007
This commit is contained in:
can-gaa-hou
2025-09-29 04:07:03 +00:00
committed by PyTorch MergeBot
parent 047ae24e34
commit e64dd8c694
5 changed files with 6 additions and 6 deletions

View File

@ -2702,7 +2702,7 @@ class TestSparseCSR(TestCase):
# Sparse CSR only supports 2D tensors as inputs
# Fail early to prevent silent success with this test
if sample.input.ndim != 2:
raise ValueError("Expected 2D tensor but got tensor with dimension: {sample.input.ndim}.")
raise ValueError(f"Expected 2D tensor but got tensor with dimension: {sample.input.ndim}.")
sample.input = sample.input.to_sparse_csr()
expect = op(sample.input, *sample.args, **sample.kwargs)
@ -2726,7 +2726,7 @@ class TestSparseCSR(TestCase):
# Sparse CSR only supports 2D tensors as inputs
# Fail early to prevent silent success with this test
if sample.input.ndim != 2:
raise ValueError("Expected 2D tensor but got tensor with dimension: {sample.input.ndim}.")
raise ValueError(f"Expected 2D tensor but got tensor with dimension: {sample.input.ndim}.")
sample.input = sample.input.to_sparse_csr()
expect = op(sample.input, *sample.args, **sample.kwargs)