Skip to content

Commit

Permalink
fix linter caused by pyre bot
Browse files Browse the repository at this point in the history
Summary: D37172721 (facebookresearch@fb36bdd) fixes pyre, and lints the code using 88 line width, while D2 (facebookresearch@11528ce) uses 100. Re-apply the linter

Reviewed By: mattcyu1

Differential Revision: D37194299

fbshipit-source-id: 09c57edfa805881604f257d429662838366733b6
  • Loading branch information
wat3rBro authored and facebook-github-bot committed Jun 16, 2022
1 parent fb36bdd commit 224cd23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions projects/DensePose/densepose/modeling/cse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def normalize_embeddings(embeddings: torch.Tensor, epsilon: float = 1e-6) -> tor
Return:
Normalized embeddings (tensor [N, D]), such that L2 vector norms are all equal to 1.
"""
return embeddings / torch.clamp(
embeddings.norm(p=None, dim=1, keepdim=True), min=epsilon
)
return embeddings / torch.clamp(embeddings.norm(p=None, dim=1, keepdim=True), min=epsilon)


def get_closest_vertices_mask_from_ES(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ def forward(
pixel_embeddings.reshape((self.embed_size, -1))[:, pixel_indices_flattened].T
)
# pixel-vertex similarity [M, K]
sim_matrix = pixel_embeddings_sampled.mm(
mesh_vertex_embeddings.T
)
sim_matrix = pixel_embeddings_sampled.mm(mesh_vertex_embeddings.T)
c_pix_vertex = F.softmax(sim_matrix / self.temperature_pix_to_vertex, dim=1)
c_vertex_pix = F.softmax(sim_matrix.T / self.temperature_vertex_to_pix, dim=1)
c_cycle = c_pix_vertex.mm(c_vertex_pix)
Expand Down

0 comments on commit 224cd23

Please sign in to comment.