Module ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Str AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list
N/A __future__ print_function N/A sys N/A chainer chainer cuda chainer function PrintHook N/A N/A function FunctionHook N/A N/A Function hook that prints debug information.

    This function hook outputs the debug information of input arguments of
    ``forward`` and ``backward`` methods involved in the hooked functions
    at preprocessing time (that is, just before each method is called).

    The basic usage is to use it with ``with`` statement.

    >>> import chainer, chainer.functions as F, chainer.links as L
    ... l = L.Linear(10, 10)
    ... x = chainer.Variable(numpy.zeros((1, 10), 'f'))
    ... with chainer.function_hooks.PrintHook():
    ...     y = l(x)
    ...     z = F.sum(y)
    ...     z.backward()

    In this example, ``PrintHook`` shows the debug information of
    forward propagations of ``LinearFunction`` (which is implicitly
    called by ``l``) and ``Sum`` (called by ``F.sum``)
    and backward propagations of ``z`` and ``y``.

    Unlike simple "debug print" technique, where users insert print functions
    at every function to be inspected, we can show the information
    of all functions involved with single ``with`` statement.

    Further, this hook enables us to show the information of
    ``backward`` methods without inserting print functions into
    Chainer's library code.

    Attributes:
        sep: Separator of print function.
        end: Character to be added at the end of print function.
        file: Output file_like object that that redirect to.
        flush: If ``True``, this hook forcibly flushes the text stream
            at the end of preprocessing.
     N/A name PrintHook __init__ N/A N/A self sep end file flush N/A N/A sys stdout True N/A N/A N/A self sep sep N/A N/A self end end N/A N/A self file file N/A N/A self flush flush N/A _print N/A N/A self msg N/A N/A N/A N/A print msg sep N/A self sep end N/A self end file N/A self file N/A _process N/A N/A self function in_data out_grad N/A None N/A N/A N/A N/A self _print N/A N/A function	{} format N/A function label N/A N/A N/A self _print input data N/A d in_data N/A N/A N/A N/A self _print N/A N/A N/A N/A chainer Variable d debug_print N/A N/A out_grad None N/A N/A N/A N/A self _print output gradient N/A d out_grad N/A N/A xp N/A N/A cuda get_array_module d N/A v N/A N/A chainer Variable N/A N/A xp zeros_like d dtype N/A d dtype N/A N/A v grad d N/A N/A N/A self _print N/A N/A v debug_print N/A N/A self flush N/A N/A N/A N/A N/A self file flush N/A forward_preprocess N/A N/A self function in_data N/A N/A N/A N/A N/A self _process function in_data N/A backward_preprocess N/A N/A self function in_data out_grad N/A N/A N/A N/A N/A self _process function in_data out_grad N/A N/A