kaolin.utils.log¶
API¶
- kaolin.utils.log.add_log_level_flag(parser)¶
Add a log_level flag to an argparser.
- Parameters
parser (ArgumentParser) – The argparser to add the flag to.
- kaolin.utils.log.default_log_setup(level=20, force=True)¶
Set up default logging to stdout and quiet optional dependencies.
- kaolin.utils.log.log_tensor(t, name, use_logger=None, level=10, print_stats=False, detailed=False)¶
Log diagnostic tensor information (shape, dtype, optional stats) via a logger.
Uses
tensor_info()to format the message.- Parameters
t (torch.Tensor or numpy.ndarray or None) – The tensor to describe.
name (str) – Human-readable name for the tensor in the log message.
use_logger (logging.Logger, optional) – Logger to use. Default: the module logger.
level (int) – Logging level (default:
logging.DEBUG, i.e. 10).print_stats (bool) – If True, include min/max/mean in the message (default: False).
detailed (bool) – If True, include extra tensor properties (default: False).
Examples
>>> t = torch.tensor([1., 2., 3.]) >>> log_tensor(t, 'my_tensor', level=logging.INFO)
- kaolin.utils.log.print_tensor(t, name, print_stats=False, detailed=False)¶
Print diagnostic tensor information (shape, dtype, optional stats) to stdout.
Uses
tensor_info()to format the message.- Parameters
t (torch.Tensor or numpy.ndarray or None) – The tensor to describe.
name (str) – Human-readable name for the tensor in the output.
print_stats (bool) – If True, include min/max/mean (default: False).
detailed (bool) – If True, include extra tensor properties (default: False).
Examples
>>> t = torch.tensor([1., 2., 3.]) >>> print_tensor(t, 'my_tensor') my_tensor: torch.Size([3]) (torch.float32)