Skip to content

Commit

Permalink
Fix # 457 (#469)
Browse files Browse the repository at this point in the history
Straightforward change of `print` call to `logging.warning`
  • Loading branch information
Evpok authored and lanpa committed Jul 16, 2019
1 parent dce4fb1 commit 97a57c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorboardX/x2num.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from __future__ import division
from __future__ import print_function

import logging
import numpy as np
import six


def check_nan(array):
tmp = np.sum(array)
if np.isnan(tmp) or np.isinf(tmp):
print('Warning: NaN or Inf found in input tensor.')
logging.warning('NaN or Inf found in input tensor.')
return array


Expand Down

0 comments on commit 97a57c0

Please sign in to comment.