mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-03 12:22:49 +08:00
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: https://github.com/facebookresearch/pytorch3d/pull/851 Reviewed By: nikhilaravi Differential Revision: D31238831 Pulled By: patricklabatut fbshipit-source-id: 0ba3e61e488e467e997954278097889be606d4f8
This commit is contained in:
parent
1aab192706
commit
720bdf60f5
@ -110,7 +110,7 @@ def matrix_to_quaternion(matrix: torch.Tensor) -> torch.Tensor:
|
|||||||
quaternions with real part first, as tensor of shape (..., 4).
|
quaternions with real part first, as tensor of shape (..., 4).
|
||||||
"""
|
"""
|
||||||
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
|
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
|
||||||
raise ValueError(f"Invalid rotation matrix shape f{matrix.shape}.")
|
raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.")
|
||||||
|
|
||||||
batch_dim = matrix.shape[:-2]
|
batch_dim = matrix.shape[:-2]
|
||||||
m00, m01, m02, m10, m11, m12, m20, m21, m22 = torch.unbind(
|
m00, m01, m02, m10, m11, m12, m20, m21, m22 = torch.unbind(
|
||||||
@ -267,7 +267,7 @@ def matrix_to_euler_angles(matrix, convention: str):
|
|||||||
if letter not in ("X", "Y", "Z"):
|
if letter not in ("X", "Y", "Z"):
|
||||||
raise ValueError(f"Invalid letter {letter} in convention string.")
|
raise ValueError(f"Invalid letter {letter} in convention string.")
|
||||||
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
|
if matrix.size(-1) != 3 or matrix.size(-2) != 3:
|
||||||
raise ValueError(f"Invalid rotation matrix shape f{matrix.shape}.")
|
raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.")
|
||||||
i0 = _index_from_letter(convention[0])
|
i0 = _index_from_letter(convention[0])
|
||||||
i2 = _index_from_letter(convention[2])
|
i2 = _index_from_letter(convention[2])
|
||||||
tait_bryan = i0 != i2
|
tait_bryan = i0 != i2
|
||||||
@ -430,7 +430,7 @@ def quaternion_apply(quaternion, point):
|
|||||||
Tensor of rotated points of shape (..., 3).
|
Tensor of rotated points of shape (..., 3).
|
||||||
"""
|
"""
|
||||||
if point.size(-1) != 3:
|
if point.size(-1) != 3:
|
||||||
raise ValueError(f"Points are not in 3D, f{point.shape}.")
|
raise ValueError(f"Points are not in 3D, {point.shape}.")
|
||||||
real_parts = point.new_zeros(point.shape[:-1] + (1,))
|
real_parts = point.new_zeros(point.shape[:-1] + (1,))
|
||||||
point_as_quaternion = torch.cat((real_parts, point), -1)
|
point_as_quaternion = torch.cat((real_parts, point), -1)
|
||||||
out = quaternion_raw_multiply(
|
out = quaternion_raw_multiply(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user