Skip to content

Commit b530b0a

Browse files
nikhilaravifacebook-github-bot
authored andcommitted
lint fixes
Summary: Resolved trailing whitespace warnings. Reviewed By: gkioxari Differential Revision: D21023982 fbshipit-source-id: 14ea2ca372c13cfa987acc260264ca99ce44c461
1 parent 3794f67 commit b530b0a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

pytorch3d/loss/point_mesh_distance.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def forward(ctx, points, points_first_idx, tris, tris_first_idx, max_points):
4141
in the corresponding example in the batch
4242
idxs: LongTensor of shape `(P,)` indicating the closest triangular face
4343
in the corresponindg example in the batch.
44-
44+
4545
`dists[p] = d(points[p], tris[idxs[p], 0], tris[idxs[p], 1], tris[idxs[p], 2])`
4646
where `d(u, v0, v1, v2)` is the distance of point `u` from the trianfular face `(v0, v1, v2)`
47-
47+
4848
"""
4949
dists, idxs = _C.point_face_dist_forward(
5050
points, points_first_idx, tris, tris_first_idx, max_points
@@ -91,7 +91,7 @@ def forward(ctx, points, points_first_idx, tris, tris_first_idx, max_tris):
9191
corresponding example in the batch
9292
idxs: LongTensor of shape `(T,)` indicating the closest point in the
9393
corresponindg example in the batch.
94-
94+
9595
`dists[t] = d(points[idxs[t]], tris[t, 0], tris[t, 1], tris[t, 2])`,
9696
where `d(u, v0, v1, v2)` is the distance of point `u` from the triangular
9797
face `(v0, v1, v2)`.
@@ -141,7 +141,7 @@ def forward(ctx, points, points_first_idx, segms, segms_first_idx, max_points):
141141
corresponding example in the batch
142142
idxs: LongTensor of shape `(P,)` indicating the closest edge in the
143143
corresponindg example in the batch.
144-
144+
145145
`dists[p] = d(points[p], segms[idxs[p], 0], segms[idxs[p], 1])`,
146146
where `d(u, v0, v1)` is the distance of point `u` from the edge segment
147147
spanned by `(v0, v1)`.
@@ -191,7 +191,7 @@ def forward(ctx, points, points_first_idx, segms, segms_first_idx, max_segms):
191191
corresponding example in the batch
192192
idxs: LongTensor of shape `(S,)` indicating the closest point in the
193193
corresponindg example in the batch.
194-
194+
195195
`dists[s] = d(points[idxs[s]], edges[s, 0], edges[s, 1])`,
196196
where `d(u, v0, v1)` is the distance of point `u` from the segment
197197
spanned by `(v0, v1)`.
@@ -226,7 +226,7 @@ def point_mesh_edge_distance(meshes: Meshes, pcls: Pointclouds):
226226
to the closest edge segment in mesh and averages across all points in pcl
227227
`edge_point(mesh, pcl)`: Computes the squared distance of each edge segment in mesh
228228
to the closest point in pcl and averages across all edges in mesh.
229-
229+
230230
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
231231
then averaged across the batch.
232232
@@ -293,7 +293,7 @@ def point_mesh_face_distance(meshes: Meshes, pcls: Pointclouds):
293293
to the closest triangular face in mesh and averages across all points in pcl
294294
`face_point(mesh, pcl)`: Computes the squared distance of each triangular face in mesh
295295
to the closest point in pcl and averages across all faces in mesh.
296-
296+
297297
The above distance functions are applied for all `(mesh, pcl)` pairs in the batch and
298298
then averaged across the batch.
299299

pytorch3d/ops/knn.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def knn_points(
125125
p1_dists: Tensor of shape (N, P1, K) giving the squared distances to
126126
the nearest neighbors. This is padded with zeros both where a cloud in p2
127127
has fewer than K points and where a cloud in p1 has fewer than P1 points.
128-
128+
129129
p2_nn: Tensor of shape (N, P1, K, D) giving the K nearest neighbors in p2 for
130130
each point in p1. Concretely, `p2_nn[n, i, k]` gives the k-th nearest neighbor
131131
for `p1[n, i]`. Returned if `return_nn` is True.
@@ -134,7 +134,7 @@ def knn_points(
134134
.. code-block::
135135
136136
p2_nn = knn_gather(p2, p1_idx, lengths2)
137-
137+
138138
which is a helper function that allows indexing any tensor of shape (N, P2, U) with
139139
the indices `p1_idx` returned by `knn_points`. The outout is a tensor
140140
of shape (N, P1, K, U).
@@ -168,7 +168,7 @@ def knn_gather(
168168
"""
169169
A helper function for knn that allows indexing a tensor x with the indices `idx`
170170
returned by `knn_points`.
171-
171+
172172
For example, if `dists, idx = knn_points(p, x, lengths_p, lengths, K)`
173173
where p is a tensor of shape (N, L, D) and x a tensor of shape (N, M, D),
174174
then one can compute the K nearest neighbors of p with `p_nn = knn_gather(x, idx, lengths)`.

tests/test_point_mesh_distance.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _point_to_edge_distance(
132132
edge: FloatTensor of shape (2, 3)
133133
Returns:
134134
dist: FloatTensor of shape (1)
135-
135+
136136
If a, b are the start and end points of the segments, we
137137
parametrize a point p as
138138
x(t) = a + t * (b - a)
@@ -165,7 +165,7 @@ def _point_to_tri_distance(point: torch.Tensor, tri: torch.Tensor) -> torch.Tens
165165
point: FloatTensor of shape (3)
166166
tri: FloatTensor of shape (3, 3)
167167
Returns:
168-
dist: FloatTensor of shape (1)
168+
dist: FloatTensor of shape (1)
169169
"""
170170
a, b, c = tri.unbind(0)
171171
cross = torch.cross(b - a, c - a)

0 commit comments

Comments
 (0)