Initial commit.
[pytorch.git] / sizer.py
index 52620e8..dff36eb 100755 (executable)
--- a/sizer.py
+++ b/sizer.py
@@ -1,10 +1,34 @@
 #!/usr/bin/env python
 
+# Any copyright is dedicated to the Public Domain.
+# https://creativecommons.org/publicdomain/zero/1.0/
+
+# Written by Francois Fleuret <francois@fleuret.org>
+
 import os, stat, sys
 import time
 import torch
 from torch import nn
 
+######################################################################
+
+if len(sys.argv) < 2:
+    print(sys.argv[0] + ''' <file to monitor>
+
+For example:
+
+(17, 3, 60, 80)
+nn.Conv2d(3, 32, 3, padding = 1)
+nn.MaxPool2d(2)
+nn.Conv2d(32, 32, 3, padding = 1)
+nn.MaxPool2d(2)
+nn.Conv2d(32, 64, 3, padding = 1)
+nn.MaxPool2d(5)
+nn.Conv2d(64, 64, (3, 4))''')
+    exit(1)
+
+######################################################################
+
 t = 0
 
 while True: