mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	suppress errors in vision/fair/pytorch3d
				
					
				
			Differential Revision: D33202801 fbshipit-source-id: d4cb0f4f4a8ad5a6519ce4b8c640e8f96fbeaccb
This commit is contained in:
		
							parent
							
								
									ccfb72cc50
								
							
						
					
					
						commit
						315f2487db
					
				@ -39,7 +39,6 @@ class GraphConv(nn.Module):
 | 
			
		||||
        if init == "normal":
 | 
			
		||||
            nn.init.normal_(self.w0.weight, mean=0, std=0.01)
 | 
			
		||||
            nn.init.normal_(self.w1.weight, mean=0, std=0.01)
 | 
			
		||||
            # pyre-fixme[16]: Optional type has no attribute `data`.
 | 
			
		||||
            self.w0.bias.data.zero_()
 | 
			
		||||
            self.w1.bias.data.zero_()
 | 
			
		||||
        elif init == "zero":
 | 
			
		||||
 | 
			
		||||
@ -87,6 +87,7 @@ def vert_align(
 | 
			
		||||
            padding_mode=padding_mode,
 | 
			
		||||
            align_corners=align_corners,
 | 
			
		||||
        )  # (N, C, 1, V)
 | 
			
		||||
        # pyre-fixme[28]: Unexpected keyword argument `dim`.
 | 
			
		||||
        feat_sampled = feat_sampled.squeeze(dim=2).transpose(1, 2)  # (N, V, C)
 | 
			
		||||
        feats_sampled.append(feat_sampled)
 | 
			
		||||
    feats_sampled = torch.cat(feats_sampled, dim=2)  # (N, V, sum(C))
 | 
			
		||||
 | 
			
		||||
@ -64,6 +64,7 @@ class HardPhongShader(nn.Module):
 | 
			
		||||
        self.cameras = cameras
 | 
			
		||||
        self.blend_params = blend_params if blend_params is not None else BlendParams()
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
 | 
			
		||||
    def to(self, device: Device):
 | 
			
		||||
        # Manually move to device modules which are not subclasses of nn.Module
 | 
			
		||||
        cameras = self.cameras
 | 
			
		||||
@ -126,6 +127,7 @@ class SoftPhongShader(nn.Module):
 | 
			
		||||
        self.cameras = cameras
 | 
			
		||||
        self.blend_params = blend_params if blend_params is not None else BlendParams()
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
 | 
			
		||||
    def to(self, device: Device):
 | 
			
		||||
        # Manually move to device modules which are not subclasses of nn.Module
 | 
			
		||||
        cameras = self.cameras
 | 
			
		||||
@ -193,6 +195,7 @@ class HardGouraudShader(nn.Module):
 | 
			
		||||
        self.cameras = cameras
 | 
			
		||||
        self.blend_params = blend_params if blend_params is not None else BlendParams()
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
 | 
			
		||||
    def to(self, device: Device):
 | 
			
		||||
        # Manually move to device modules which are not subclasses of nn.Module
 | 
			
		||||
        cameras = self.cameras
 | 
			
		||||
@ -259,6 +262,7 @@ class SoftGouraudShader(nn.Module):
 | 
			
		||||
        self.cameras = cameras
 | 
			
		||||
        self.blend_params = blend_params if blend_params is not None else BlendParams()
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
 | 
			
		||||
    def to(self, device: Device):
 | 
			
		||||
        # Manually move to device modules which are not subclasses of nn.Module
 | 
			
		||||
        cameras = self.cameras
 | 
			
		||||
@ -346,6 +350,7 @@ class HardFlatShader(nn.Module):
 | 
			
		||||
        self.cameras = cameras
 | 
			
		||||
        self.blend_params = blend_params if blend_params is not None else BlendParams()
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[14]: `to` overrides method defined in `Module` inconsistently.
 | 
			
		||||
    def to(self, device: Device):
 | 
			
		||||
        # Manually move to device modules which are not subclasses of nn.Module
 | 
			
		||||
        cameras = self.cameras
 | 
			
		||||
 | 
			
		||||
@ -131,7 +131,12 @@ def _pad_texture_maps(
 | 
			
		||||
        if image.shape[:2] != max_shape:
 | 
			
		||||
            image_BCHW = image.permute(2, 0, 1)[None]
 | 
			
		||||
            new_image_BCHW = interpolate(
 | 
			
		||||
                image_BCHW, size=max_shape, mode="bilinear", align_corners=align_corners
 | 
			
		||||
                image_BCHW,
 | 
			
		||||
                # pyre-fixme[6]: Expected `Optional[int]` for 2nd param but got
 | 
			
		||||
                #  `Tuple[int, int]`.
 | 
			
		||||
                size=max_shape,
 | 
			
		||||
                mode="bilinear",
 | 
			
		||||
                align_corners=align_corners,
 | 
			
		||||
            )
 | 
			
		||||
            tex_maps[i] = new_image_BCHW[0].permute(1, 2, 0)
 | 
			
		||||
    tex_maps = torch.stack(tex_maps, dim=0)  # (num_tex_maps, max_H, max_W, C)
 | 
			
		||||
 | 
			
		||||
@ -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")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user