X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=pytorch.git;a=blobdiff_plain;f=ae_size.py;h=49f4a2037b449a13c1401e6e0a673a1483b4d893;hp=067a7fa7bc1d44f4330e7f37fe1e511d3fd92045;hb=05b9b133a45ac9bd5abe6f8b6d29095f9c82797a;hpb=ca897077ed89fbc3c7e8d812ad262146a0c72b71 diff --git a/ae_size.py b/ae_size.py index 067a7fa..49f4a20 100755 --- a/ae_size.py +++ b/ae_size.py @@ -11,8 +11,9 @@ 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: @@ -21,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 = []