From a0f786f4cf600a8b1741ef8b5b24bc99272ab0e7 Mon Sep 17 00:00:00 2001 From: Pyre Bot Jr <> Date: Thu, 4 Aug 2022 22:18:46 -0700 Subject: [PATCH] upgrade pyre version in `fbcode/vision` - batch 2 Differential Revision: D38448021 fbshipit-source-id: 966708035115b4870a74f0ca0bbf8ea88b853527 --- pytorch3d/implicitron/models/generic_model.py | 1 + pytorch3d/implicitron/tools/video_writer.py | 4 ---- pytorch3d/io/obj_io.py | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pytorch3d/implicitron/models/generic_model.py b/pytorch3d/implicitron/models/generic_model.py index d4506245..8df1bac4 100644 --- a/pytorch3d/implicitron/models/generic_model.py +++ b/pytorch3d/implicitron/models/generic_model.py @@ -532,6 +532,7 @@ class GenericModel(ImplicitronModelBase): # pyre-ignore: 13 return None loss = sum(losses_weighted) assert torch.is_tensor(loss) + # pyre-fixme[7]: Expected `Optional[Tensor]` but got `int`. return loss def visualize( diff --git a/pytorch3d/implicitron/tools/video_writer.py b/pytorch3d/implicitron/tools/video_writer.py index 7d5edd44..364dabee 100644 --- a/pytorch3d/implicitron/tools/video_writer.py +++ b/pytorch3d/implicitron/tools/video_writer.py @@ -84,8 +84,6 @@ class VideoWriter: or a 2-tuple defining the size of the output image. """ - # pyre-fixme[6]: For 1st param expected `Union[PathLike[str], str]` but got - # `Optional[str]`. outfile = os.path.join(self.cache_dir, self.regexp % self.frame_num) if isinstance(frame, matplotlib.figure.Figure): @@ -127,8 +125,6 @@ class VideoWriter: video_path: The path to the generated video. """ - # pyre-fixme[6]: For 1st param expected `Union[PathLike[str], str]` but got - # `Optional[str]`. regexp = os.path.join(self.cache_dir, self.regexp) if self.output_format == "visdom": # works for ppt too diff --git a/pytorch3d/io/obj_io.py b/pytorch3d/io/obj_io.py index 6d3e7eca..e506325e 100644 --- a/pytorch3d/io/obj_io.py +++ b/pytorch3d/io/obj_io.py @@ -215,8 +215,6 @@ def load_obj( """ data_dir = "./" if isinstance(f, (str, bytes, Path)): - # pyre-fixme[6]: For 1st param expected `PathLike[Variable[AnyStr <: [str, - # bytes]]]` but got `Union[Path, bytes, str]`. data_dir = os.path.dirname(f) if path_manager is None: path_manager = PathManager()