sksq96 / pytorch-summary

Model summary in PyTorch similar to `model.summary()` in Keras
MIT License
4.01k stars 412 forks source link

fix: bug caused when total_params is zero #196

Closed LiuZengqiang closed 1 year ago

LiuZengqiang commented 1 year ago

If the model is empty, the total_params is 0(int), it has no function .numpy(). It is should inialize with torch.tensor(1, dtype=int) type.