lint things

Summary:
Lint related fixes: Improve internal/OSS consistency. Fix the fight between black and certain pyre-ignore markers by moving them to the line before.
Use clang-format-8 automatically if present. Small number of pyre fixes.

arc doesn't run pyre at the moment, so I put back the explicit call to pyre. I don't know if there's an option somewhere to change this.

Reviewed By: nikhilaravi

Differential Revision: D19780518

fbshipit-source-id: ef1c243392322fa074130f6cff2dd8a6f7738a7f
This commit is contained in:
Jeremy Reizenstein
2020-02-21 05:03:38 -08:00
committed by Facebook Github Bot
parent 9e21659fc5
commit e491efb81f
11 changed files with 66 additions and 52 deletions

View File

@@ -2,6 +2,7 @@
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import functools
from typing import Optional
import torch
@@ -246,7 +247,10 @@ def matrix_to_euler_angles(matrix, convention: str):
def random_quaternions(
n: int, dtype: torch.dtype = None, device=None, requires_grad=False
n: int,
dtype: Optional[torch.dtype] = None,
device=None,
requires_grad=False,
):
"""
Generate random quaternions representing rotations,
@@ -272,7 +276,10 @@ def random_quaternions(
def random_rotations(
n: int, dtype: torch.dtype = None, device=None, requires_grad=False
n: int,
dtype: Optional[torch.dtype] = None,
device=None,
requires_grad=False,
):
"""
Generate random rotations as 3x3 rotation matrices.
@@ -295,7 +302,7 @@ def random_rotations(
def random_rotation(
dtype: torch.dtype = None, device=None, requires_grad=False
dtype: Optional[torch.dtype] = None, device=None, requires_grad=False
):
"""
Generate a single random 3x3 rotation matrix.

View File

@@ -3,6 +3,7 @@
import math
import warnings
from typing import Optional
import torch
from .rotation_conversions import _axis_angle_rotation
@@ -250,7 +251,7 @@ class Transform3d:
out._matrix = matrix
return out
def transform_points(self, points, eps: float = None):
def transform_points(self, points, eps: Optional[float] = None):
"""
Use this transform to transform a set of 3D points. Assumes row major
ordering of the input points.