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: D31496551 fbshipit-source-id: 705fd88f319875db3f7938a2946c48a51ea225f5
This commit is contained in:
		
							parent
							
								
									6dfa326922
								
							
						
					
					
						commit
						6d36c1e2b0
					
				@ -117,7 +117,6 @@ def marching_cubes_naive(
 | 
			
		||||
    volume_data_batch = volume_data_batch.detach().cpu()
 | 
			
		||||
    batched_verts, batched_faces = [], []
 | 
			
		||||
    D, H, W = volume_data_batch.shape[1:]
 | 
			
		||||
    # pyre-ignore [16]
 | 
			
		||||
    volume_size_xyz = volume_data_batch.new_tensor([W, H, D])[None]
 | 
			
		||||
 | 
			
		||||
    if return_local_coords:
 | 
			
		||||
 | 
			
		||||
@ -435,7 +435,6 @@ def _add_points_features_to_volume_densities_features_python(
 | 
			
		||||
 | 
			
		||||
    if volume_features is None:
 | 
			
		||||
        # initialize features if not passed in
 | 
			
		||||
        # pyre-fixme[16]: `Tensor` has no attribute `new_zeros`.
 | 
			
		||||
        volume_features_flatten = volume_densities.new_zeros(ba, feature_dim, n_voxels)
 | 
			
		||||
    else:
 | 
			
		||||
        # otherwise just flatten
 | 
			
		||||
@ -478,7 +477,6 @@ def _check_points_to_volumes_inputs(
 | 
			
		||||
    mask: Optional[torch.Tensor] = None,
 | 
			
		||||
):
 | 
			
		||||
 | 
			
		||||
    # pyre-fixme[16]: `Tuple` has no attribute `values`.
 | 
			
		||||
    max_grid_size = grid_sizes.max(dim=0).values
 | 
			
		||||
    if torch.prod(max_grid_size) > volume_densities.shape[1]:
 | 
			
		||||
        raise ValueError(
 | 
			
		||||
 | 
			
		||||
@ -134,7 +134,6 @@ def sample_farthest_points_naive(
 | 
			
		||||
        # Initialize closest distances to inf, shape: (P,)
 | 
			
		||||
        # This will be updated at each iteration to track the closest distance of the
 | 
			
		||||
        # remaining points to any of the selected points
 | 
			
		||||
        # pyre-fixme[16]: `torch.Tensor` has no attribute new_full.
 | 
			
		||||
        closest_dists = points.new_full(
 | 
			
		||||
            (lengths[n],), float("inf"), dtype=torch.float32
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
@ -67,7 +67,7 @@ def hard_rgb_blend(
 | 
			
		||||
    if isinstance(background_color_, torch.Tensor):
 | 
			
		||||
        background_color = background_color_.to(device)
 | 
			
		||||
    else:
 | 
			
		||||
        background_color = colors.new_tensor(background_color_)  # pyre-fixme[16]
 | 
			
		||||
        background_color = colors.new_tensor(background_color_)
 | 
			
		||||
 | 
			
		||||
    # Find out how much background_color needs to be expanded to be used for masked_scatter.
 | 
			
		||||
    num_background_pixels = is_background.sum()
 | 
			
		||||
@ -217,7 +217,6 @@ def softmax_rgb_blend(
 | 
			
		||||
        znear = znear[:, None, None, None]
 | 
			
		||||
 | 
			
		||||
    z_inv = (zfar - fragments.zbuf) / (zfar - znear) * mask
 | 
			
		||||
    # pyre-fixme[16]: `Tuple` has no attribute `values`.
 | 
			
		||||
    z_inv_max = torch.max(z_inv, dim=-1).values[..., None].clamp(min=eps)
 | 
			
		||||
    weights_num = prob_map * torch.exp((z_inv - z_inv_max) / blend_params.gamma)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -298,7 +298,7 @@ def _xy_to_ray_bundle(
 | 
			
		||||
            .reshape(batch_size, n_rays_per_image * 2, 2),
 | 
			
		||||
            torch.cat(
 | 
			
		||||
                (
 | 
			
		||||
                    xy_grid.new_ones(batch_size, n_rays_per_image, 1),  # pyre-ignore
 | 
			
		||||
                    xy_grid.new_ones(batch_size, n_rays_per_image, 1),
 | 
			
		||||
                    2.0 * xy_grid.new_ones(batch_size, n_rays_per_image, 1),
 | 
			
		||||
                ),
 | 
			
		||||
                dim=1,
 | 
			
		||||
 | 
			
		||||
@ -475,7 +475,6 @@ def rasterize_meshes_python(  # noqa: C901
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    # Calculate all face bounding boxes.
 | 
			
		||||
    # pyre-fixme[16]: `Tuple` has no attribute `values`.
 | 
			
		||||
    x_mins = torch.min(faces_verts[:, :, 0], dim=1, keepdim=True).values
 | 
			
		||||
    x_maxs = torch.max(faces_verts[:, :, 0], dim=1, keepdim=True).values
 | 
			
		||||
    y_mins = torch.min(faces_verts[:, :, 1], dim=1, keepdim=True).values
 | 
			
		||||
 | 
			
		||||
@ -1134,7 +1134,6 @@ class TexturesUV(TexturesBase):
 | 
			
		||||
            )
 | 
			
		||||
        merging_plan = pack_unique_rectangles(heights_and_widths)
 | 
			
		||||
        C = maps[0].shape[-1]
 | 
			
		||||
        # pyre-fixme[16]: `Tensor` has no attribute `new_zeros`.
 | 
			
		||||
        single_map = maps[0].new_zeros((*merging_plan.total_size, C))
 | 
			
		||||
        verts_uvs = self.verts_uvs_list()
 | 
			
		||||
        verts_uvs_merged = []
 | 
			
		||||
 | 
			
		||||
@ -52,7 +52,6 @@ def list_to_padded(
 | 
			
		||||
 | 
			
		||||
    # replace empty 1D tensors with empty tensors with a correct number of dimensions
 | 
			
		||||
    x = [
 | 
			
		||||
        # pyre-fixme[16]: `Tensor` has no attribute `new_zeros`.
 | 
			
		||||
        (y.new_zeros([0] * element_ndim) if (y.ndim == 1 and y.nelement() == 0) else y)
 | 
			
		||||
        for y in x
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
@ -142,7 +142,6 @@ def matrix_to_quaternion(matrix: torch.Tensor) -> torch.Tensor:
 | 
			
		||||
 | 
			
		||||
    # We floor here at 0.1 but the exact level is not important; if q_abs is small,
 | 
			
		||||
    # the candidate won't be picked.
 | 
			
		||||
    # pyre-ignore [16]: `torch.Tensor` has no attribute `new_tensor`.
 | 
			
		||||
    quat_candidates = quat_by_rijk / (2.0 * q_abs[..., None].max(q_abs.new_tensor(0.1)))
 | 
			
		||||
 | 
			
		||||
    # if not for numerical problems, quat_candidates[i] should be same (up to a sign),
 | 
			
		||||
 | 
			
		||||
@ -791,7 +791,7 @@ def _add_ray_bundle_trace(
 | 
			
		||||
    # make ray line endpoints
 | 
			
		||||
    min_max_ray_depth = torch.stack(
 | 
			
		||||
        [
 | 
			
		||||
            ray_bundle_flat.lengths.min(dim=1).values,  # pyre-ignore[16]
 | 
			
		||||
            ray_bundle_flat.lengths.min(dim=1).values,
 | 
			
		||||
            ray_bundle_flat.lengths.max(dim=1).values,
 | 
			
		||||
        ],
 | 
			
		||||
        dim=-1,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user