Commit 2e058ee1 authored by Yuxin Wu's avatar Yuxin Wu

Add more checks in add_moving_summary

parent e515ad88
...@@ -223,8 +223,9 @@ def add_moving_summary(*args, **kwargs): ...@@ -223,8 +223,9 @@ def add_moving_summary(*args, **kwargs):
log_deprecated("Call add_moving_summary with positional args instead of a list!", eos="2018-02-28") log_deprecated("Call add_moving_summary with positional args instead of a list!", eos="2018-02-28")
v = args[0] v = args[0]
for x in v: for x in v:
assert isinstance(x, tf.Tensor), x assert isinstance(x, (tf.Tensor, tf.Variable)), x
assert x.get_shape().ndims == 0, x.get_shape() assert x.get_shape().ndims == 0, \
"add_moving_summary() only accepts scalar tensor! Got one with {}".format(x.get_shape())
G = tf.get_default_graph() G = tf.get_default_graph()
# TODO variable not saved under distributed # TODO variable not saved under distributed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment