Skip to content

Commit 438c194

Browse files
trederfacebook-github-bot
authored andcommitted
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: #1324 Reviewed By: bottler Differential Revision: D39259775 Pulled By: davnov134 fbshipit-source-id: e01bb747ac80c812eb27bf22e67f5e14f29acadd
1 parent dd58ded commit 438c194

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pytorch3d/renderer/implicit/raysampling.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def forward(
124124
max_depth: Optional[float] = None,
125125
n_rays_per_image: Optional[int] = None,
126126
n_pts_per_ray: Optional[int] = None,
127-
stratified_sampling: bool = False,
127+
stratified_sampling: Optional[bool] = None,
128128
**kwargs,
129129
) -> RayBundle:
130130
"""
@@ -313,7 +313,11 @@ def __init__(
313313
self._stratified_sampling = stratified_sampling
314314

315315
def forward(
316-
self, cameras: CamerasBase, *, stratified_sampling: bool = False, **kwargs
316+
self,
317+
cameras: CamerasBase,
318+
*,
319+
stratified_sampling: Optional[bool] = None,
320+
**kwargs,
317321
) -> RayBundle:
318322
"""
319323
Args:

0 commit comments

Comments
 (0)