ref: https://github.com/awwong1/torchprof FLOPs 下面这个刚出来的: https://github.com/mit-han-lab/torchprofile 参数量计算 def params_count(model): """ Compute the number of parameters. Args: model (model): model to count the number of parameters. """ return np.sum([p.numel() for p in model.parameters()]).item()