title: What does Pytorch's nn.Linear(x,y) return?
body: <p>I am new to object orientation, and I am having troubles understanding the following:</p>
  <pre><code>import torch.nn as nn
  
  class mynet(nn.Module):
      def __init__(self):
          super().__init__()
          self.fc1 = nn.Linear(20, 64)
      
      def forward(self, x):
          x = self.fc1(x)
  
  </code></pre>
  <p>The line <code>self.fc1 = nn.Linear(20, 64) </code> is supposed to create a member variable fc1 to my class, right? But what is the return value of nn.Linear(20, 64)?</p>
  <p>According to the documentation, nn.Linear is defined as
  <code>class torch.nn.Linear(in_features: int, out_features: int, bias: bool = True)</code>.</p>
  <p>However, in my basic OOP tutorial I have only seen something like <code>class CLASSNAME(BASECLASS)</code> so that the class CLASSNAME inherits from BASECLASS. What does the documentation mean with its way of writing all that stuff in between the brackets?</p>
  <p>Also, the line <code>x=fc1(x)</code> somehow makes it look as if fc1 was a function now.</p>
  <p>I seem to lack OOP knowledge here... Any help appreciated!</p>