Skip to content

Commit 23bb279

Browse files
bottlerfacebook-github-bot
authored andcommitted
remove print statements
Reviewed By: gkioxari Differential Revision: D19834684 fbshipit-source-id: 553dbf84d1062149b4915d313fc0f96eb047798c
1 parent 09992a3 commit 23bb279

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pytorch3d/renderer/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
import numpy as np
6+
import warnings
67
from typing import Any, Union
78
import torch
89

@@ -111,7 +112,7 @@ def __init__(self, dtype=torch.float32, device="cpu", **kwargs):
111112
args_to_broadcast[k] = v
112113
else:
113114
msg = "Arg %s with type %r is not broadcastable"
114-
print(msg % (k, type(v)))
115+
warnings.warn(msg % (k, type(v)))
115116

116117
names = args_to_broadcast.keys()
117118
# convert from type dict.values to tuple

pytorch3d/transforms/transform3d.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
33

44
import math
5+
import warnings
56
import torch
67

78

@@ -663,7 +664,7 @@ def _check_valid_rotation_matrix(R, tol: float = 1e-7):
663664
Returns:
664665
None
665666
666-
Prints an warning if R is an invalid rotation matrix. Else return.
667+
Emits a warning if R is an invalid rotation matrix.
667668
"""
668669
N = R.shape[0]
669670
eye = torch.eye(3, dtype=R.dtype, device=R.device)
@@ -673,5 +674,5 @@ def _check_valid_rotation_matrix(R, tol: float = 1e-7):
673674
no_distortion = torch.allclose(det_R, torch.ones_like(det_R))
674675
if not (orthogonal and no_distortion):
675676
msg = "R is not a valid rotation matrix"
676-
print(msg)
677+
warnings.warn(msg)
677678
return

0 commit comments

Comments
 (0)