Update.
[pytorch.git] / ae_size.py
index 8afb101..49f4a20 100755 (executable)
@@ -1,13 +1,19 @@
 #!/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 math
 from torch import nn
 from torch import Tensor
 
 ######################################################################
 
+
 def minimal_input_size(w, layer_specs):
-    assert w > 0, 'The input is too small'
+    assert w > 0, "The input is too small"
     if layer_specs == []:
         return w
     else:
@@ -16,13 +22,13 @@ def minimal_input_size(w, layer_specs):
         v = minimal_input_size(v, layer_specs[1:])
         return (v - 1) * stride + kernel_size
 
+
 ######################################################################
 
 # Dummy test
 
 if __name__ == "__main__":
-
-    layer_specs = [ (17, 5), (5, 4), (3, 2), (3, 2) ]
+    layer_specs = [(17, 5), (5, 4), (3, 2), (3, 2)]
 
     layers = []