Initial commit.
[pytorch.git] / lazy_linear.py
index b3d3165..97530ef 100755 (executable)
@@ -1,5 +1,10 @@
 #!/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>
+
 from torch import nn, Tensor
 
 ######################################################################
@@ -7,7 +12,7 @@ from torch import nn, Tensor
 class LazyLinear(nn.Module):
 
     def __init__(self, out_dim, bias = True):
-        super(LazyLinear, self).__init__()
+        super().__init__()
         self.out_dim = out_dim
         self.bias = bias
         self.core = None
@@ -25,7 +30,7 @@ class LazyLinear(nn.Module):
 
     def named_parameters(self, memo=None, prefix=''):
         assert self.core is not None, 'Parameters not yet defined'
-        return super(LazyLinear, self).named_parameters(memo, prefix)
+        return super().named_parameters(memo, prefix)
 
 ######################################################################