example of calculate sparsity of pytorch Module.

using torch.nn.Module.register_forward_hook .