Skip to content

Commit 720bdf6

Browse files
Theo-Cheynelfacebook-github-bot
authored andcommitted
Removed typos 'f' from the f-string error messages (#851)
Summary: Changed mistake in Python f-strings causing an additional letter "f" to appear in the error messages. The error messages would read something like : ``` raise ValueError(f"Invalid rotation matrix shape f{matrix.shape}.") ValueError: Invalid rotation matrix shape ftorch.Size([4, 4]). ``` (with an additional f, probably a mistake) Pull Request resolved: #851 Reviewed By: nikhilaravi Differential Revision: D31238831 Pulled By: patricklabatut fbshipit-source-id: 0ba3e61e488e467e997954278097889be606d4f8
1 parent 1aab192 commit 720bdf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytorch3d/transforms/rotation_conversions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def matrix_to_quaternion(matrix: torch.Tensor) -> torch.Tensor:
110110
quaternions with real part first, as tensor of shape (..., 4).
111111
"""
112112
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
113-
raise ValueError(f"Invalid rotation matrix shape f{matrix.shape}.")
113+
raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.")
114114

115115
batch_dim = matrix.shape[:-2]
116116
m00, m01, m02, m10, m11, m12, m20, m21, m22 = torch.unbind(
@@ -267,7 +267,7 @@ def matrix_to_euler_angles(matrix, convention: str):
267267
if letter not in ("X", "Y", "Z"):
268268
raise ValueError(f"Invalid letter {letter} in convention string.")
269269
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
270-
raise ValueError(f"Invalid rotation matrix shape f{matrix.shape}.")
270+
raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.")
271271
i0 = _index_from_letter(convention[0])
272272
i2 = _index_from_letter(convention[2])
273273
tait_bryan = i0 != i2
@@ -430,7 +430,7 @@ def quaternion_apply(quaternion, point):
430430
Tensor of rotated points of shape (..., 3).
431431
"""
432432
if point.size(-1) != 3:
433-
raise ValueError(f"Points are not in 3D, f{point.shape}.")
433+
raise ValueError(f"Points are not in 3D, {point.shape}.")
434434
real_parts = point.new_zeros(point.shape[:-1] + (1,))
435435
point_as_quaternion = torch.cat((real_parts, point), -1)
436436
out = quaternion_raw_multiply(

0 commit comments

Comments
 (0)