mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
remove print statements
Reviewed By: gkioxari Differential Revision: D19834684 fbshipit-source-id: 553dbf84d1062149b4915d313fc0f96eb047798c
This commit is contained in:
parent
09992a388f
commit
23bb27956a
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import warnings
|
||||||
from typing import Any, Union
|
from typing import Any, Union
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ class TensorProperties(object):
|
|||||||
args_to_broadcast[k] = v
|
args_to_broadcast[k] = v
|
||||||
else:
|
else:
|
||||||
msg = "Arg %s with type %r is not broadcastable"
|
msg = "Arg %s with type %r is not broadcastable"
|
||||||
print(msg % (k, type(v)))
|
warnings.warn(msg % (k, type(v)))
|
||||||
|
|
||||||
names = args_to_broadcast.keys()
|
names = args_to_broadcast.keys()
|
||||||
# convert from type dict.values to tuple
|
# convert from type dict.values to tuple
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
import warnings
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
||||||
@ -663,7 +664,7 @@ def _check_valid_rotation_matrix(R, tol: float = 1e-7):
|
|||||||
Returns:
|
Returns:
|
||||||
None
|
None
|
||||||
|
|
||||||
Prints an warning if R is an invalid rotation matrix. Else return.
|
Emits a warning if R is an invalid rotation matrix.
|
||||||
"""
|
"""
|
||||||
N = R.shape[0]
|
N = R.shape[0]
|
||||||
eye = torch.eye(3, dtype=R.dtype, device=R.device)
|
eye = torch.eye(3, dtype=R.dtype, device=R.device)
|
||||||
@ -673,5 +674,5 @@ def _check_valid_rotation_matrix(R, tol: float = 1e-7):
|
|||||||
no_distortion = torch.allclose(det_R, torch.ones_like(det_R))
|
no_distortion = torch.allclose(det_R, torch.ones_like(det_R))
|
||||||
if not (orthogonal and no_distortion):
|
if not (orthogonal and no_distortion):
|
||||||
msg = "R is not a valid rotation matrix"
|
msg = "R is not a valid rotation matrix"
|
||||||
print(msg)
|
warnings.warn(msg)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user