suppress errors in vision/fair/pytorch3d

Differential Revision: D33202801

fbshipit-source-id: d4cb0f4f4a8ad5a6519ce4b8c640e8f96fbeaccb
This commit is contained in:
Pyre Bot Jr
2021-12-17 19:23:04 -08:00
committed by Facebook GitHub Bot
parent ccfb72cc50
commit 315f2487db
5 changed files with 14 additions and 2 deletions

View File

@@ -163,6 +163,7 @@ class TensorProperties(nn.Module):
msg = "Expected index of type int or slice; got %r"
raise ValueError(msg % type(index))
# pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
def to(self, device: Device = "cpu") -> "TensorProperties":
"""
In place operation to move class properties which are tensors to a
@@ -180,6 +181,7 @@ class TensorProperties(nn.Module):
def cpu(self) -> "TensorProperties":
return self.to("cpu")
# pyre-fixme[14]: `cuda` overrides method defined in `Module` inconsistently.
def cuda(self, device: Optional[int] = None) -> "TensorProperties":
return self.to(f"cuda:{device}" if device is not None else "cuda")