mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	stratified_sampling argument: set default to None (#1324)
Summary: The self._stratified_sampling attribute is always overridden unless stratified_sampling is explicitly set to None. However, the desired default behavior is that the value of self._stratified_sampling is used unless the argument stratified_sampling is set to True/False. Changing the default to None achieves this Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1324 Reviewed By: bottler Differential Revision: D39259775 Pulled By: davnov134 fbshipit-source-id: e01bb747ac80c812eb27bf22e67f5e14f29acadd
This commit is contained in:
		
							parent
							
								
									dd58ded73d
								
							
						
					
					
						commit
						438c194ec6
					
				@ -124,7 +124,7 @@ class MultinomialRaysampler(torch.nn.Module):
 | 
			
		||||
        max_depth: Optional[float] = None,
 | 
			
		||||
        n_rays_per_image: Optional[int] = None,
 | 
			
		||||
        n_pts_per_ray: Optional[int] = None,
 | 
			
		||||
        stratified_sampling: bool = False,
 | 
			
		||||
        stratified_sampling: Optional[bool] = None,
 | 
			
		||||
        **kwargs,
 | 
			
		||||
    ) -> RayBundle:
 | 
			
		||||
        """
 | 
			
		||||
@ -313,7 +313,11 @@ class MonteCarloRaysampler(torch.nn.Module):
 | 
			
		||||
        self._stratified_sampling = stratified_sampling
 | 
			
		||||
 | 
			
		||||
    def forward(
 | 
			
		||||
        self, cameras: CamerasBase, *, stratified_sampling: bool = False, **kwargs
 | 
			
		||||
        self,
 | 
			
		||||
        cameras: CamerasBase,
 | 
			
		||||
        *,
 | 
			
		||||
        stratified_sampling: Optional[bool] = None,
 | 
			
		||||
        **kwargs,
 | 
			
		||||
    ) -> RayBundle:
 | 
			
		||||
        """
 | 
			
		||||
        Args:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user