suppress errors in vision/fair/pytorch3d

Differential Revision: D22519468

fbshipit-source-id: 6e39c2e50ef95f37df407dbc6d186cc97832fc7d
This commit is contained in:
generatedunixname89002005307016 2020-07-13 18:38:41 -07:00 committed by Facebook GitHub Bot
parent 26d2cc24c1
commit 09c1762939

View File

@ -52,6 +52,7 @@ def interpolate_face_attributes(
pix_to_face = pix_to_face.view(-1)
barycentric_coords = barycentric_coords.view(N * H * W * K, 3)
args = (pix_to_face, barycentric_coords, face_attributes)
# pyre-fixme[16]: `_InterpFaceAttrs` has no attribute `apply`.
out = _InterpFaceAttrs.apply(*args)
out = out.view(N, H, W, K, -1)
return out
@ -89,6 +90,7 @@ def interpolate_face_attributes_python(
pix_to_face = pix_to_face.clone()
pix_to_face[mask] = 0
idx = pix_to_face.view(N * H * W * K, 1, 1).expand(N * H * W * K, 3, D)
# pyre-fixme[16]: `Tensor` has no attribute `gather`.
pixel_face_vals = face_attributes.gather(0, idx).view(N, H, W, K, 3, D)
pixel_vals = (barycentric_coords[..., None] * pixel_face_vals).sum(dim=-2)
pixel_vals[mask] = 0 # Replace masked values in output.