chainer.function_hooks.CUDAProfileHook

class chainer.function_hooks.CUDAProfileHook[source]

Methods

__enter__()[source]
__exit__(*_)[source]
added(function=None)[source]

Callback function invoked when a function hook is added

Parameters:function (FunctionNode) – Function object to which the function hook is added.
backward_postprocess(function, in_data, out_grad)[source]

Callback function invoked after backward propagation.

Parameters:
  • function (FunctionNode) – Function object to which the function hook is registered.
  • in_data (tuple of numpy.ndarray or tuple of cupy.ndarray) – Input of forward propagation.
  • out_grad (tuple of numpy.ndarray or tuple of cupy.ndarray) – Gradient data of backward propagation.
backward_preprocess(function, in_data, out_grad)[source]

Callback function invoked before backward propagation.

Parameters:
  • function (FunctionNode) – Function object to which the function hook is registered.
  • in_data (tuple of numpy.ndarray or tuple of cupy.ndarray) – Input data of forward propagation.
  • out_grad (tuple of numpy.ndarray or tuple of cupy.ndarray) – Gradient data of backward propagation.
deleted(function=None)[source]

Callback function invoked when a function hook is deleted

Parameters:function (FunctionNode) – Function object to which the function hook is deleted.
forward_postprocess(function, in_data)[source]

Callback function invoked after forward propagation.

Parameters:
  • function (FunctionNode) – Function object to which the function hook is registered.
  • in_data (tuple of numpy.ndarray or tuple of cupy.ndarray) – Input data of forward propagation.
forward_preprocess(function, in_data)[source]

Callback function invoked before forward propagation.

Parameters:
  • function (FunctionNode) – Function object to which the function hook is registered.
  • in_data (tuple of numpy.ndarray or tuple of cupy.ndarray) – Input data of forward propagation.

Attributes

name = 'CUDAProfileHook'