diff --git a/theseus/core/tests/test_objective.py b/theseus/core/tests/test_objective.py index ab873f1b4..591e43a8c 100644 --- a/theseus/core/tests/test_objective.py +++ b/theseus/core/tests/test_objective.py @@ -281,7 +281,7 @@ def test_objective_error(): np.testing.assert_almost_equal(error, expected_objective_error) # Test the squared error function - squared_error = np.sum(expected_objective_error ** 2) + squared_error = np.sum(expected_objective_error**2) np.testing.assert_almost_equal( objective.error_squared_norm().numpy(), squared_error ) diff --git a/theseus/geometry/se2.py b/theseus/geometry/se2.py index 3c2f78179..a15bd0cba 100644 --- a/theseus/geometry/se2.py +++ b/theseus/geometry/se2.py @@ -150,7 +150,7 @@ def exp_map(tangent_vector: torch.Tensor) -> LieGroup: idx_small_thetas = theta.abs() < theseus.constants.EPS if idx_small_thetas.any(): small_theta = theta[idx_small_thetas] - small_theta_sq = small_theta ** 2 + small_theta_sq = small_theta**2 sin_theta_by_theta[idx_small_thetas] = -small_theta_sq / 6 + 1 one_minus_cos_theta_by_theta[idx_small_thetas] = ( 0.5 * small_theta - small_theta / 24 * small_theta_sq diff --git a/theseus/utils/examples/motion_planning/models.py b/theseus/utils/examples/motion_planning/models.py index 6a994f8e1..89fcd1a44 100644 --- a/theseus/utils/examples/motion_planning/models.py +++ b/theseus/utils/examples/motion_planning/models.py @@ -183,7 +183,7 @@ def forward(self, batch: Dict[str, Any]): for t_step in range(1, trajectory_len): idx = 4 * t_step cur_t += start_goal_dist / (trajectory_len - 1) - add = 2 * bend_factor * ((cur_t ** 2 - c) / c).view(-1, 1) + add = 2 * bend_factor * ((cur_t**2 - c) / c).view(-1, 1) trajectory[:, idx : idx + 2] += normal_vector * add # Compute resulting velocities