computational_cost_hook.py p�VG�U �0'G�U from __future__ import print_function import sys import chainer from chainer.utils import conv class ComputationalCostHook(chainer.function.FunctionHook): name = 'ComputationalCostHook' def __init__(self, sep='', end='\n', file=sys.stdout, flush=True): self.sep = sep self.end = end self.file = file self.flush = flush self._print( 'function\tbatch_size\tin_w
![Hook implementation to calculate roughly estimated computational cost of a given network for Chainer](https://cdn-ak-scissors.b.st-hatena.com/image/square/1ef26f6cb4349557952890dbe3e567f7f98dc151/height=288;version=1;width=512/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png)