MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / print_stat

Function print_stat

tensorpack/tfutils/symbolic_functions.py:12–22  ·  view source on GitHub ↗

A simple print Op that might be easier to use than :meth:`tf.Print`. Use it like: ``x = print_stat(x, message='This is x')``.

(x, message=None)

Source from the content-addressed store, hash-verified

10
11
12def print_stat(x, message=None):
13 """ A simple print Op that might be easier to use than :meth:`tf.Print`.
14 Use it like: ``x = print_stat(x, message='This is x')``.
15 """
16 if message is None:
17 message = x.op.name
18 lst = [tf.shape(x), tf.reduce_mean(x)]
19 if x.dtype.is_floating:
20 lst.append(rms(x))
21 return tf.Print(x, lst + [x], summarize=20,
22 message=message, name='print_' + x.op.name)
23
24
25# for internal use only

Callers 1

_mapperMethod · 0.85

Calls 3

rmsFunction · 0.85
shapeMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected