mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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:
committed by
PyTorch MergeBot
parent
047ae24e34
commit
e64dd8c694
@ -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)
|
||||
|
Reference in New Issue
Block a user