Code:
from torch.nn import Linear
model  = Linear(in_features = 1, out_features = 1)
y = model(x)           # calling an instance of class Linear
Although, ‘Linear’ class inherits ‘Module’ class, which has ‘__ call__()’ defined in it. I could not catch it from there. Kindly help.
As far as I know; In python, to call an instance (here model()) of a class, the class must have ‘__ call__()’ defined in it. But how does this work in the case of class- ‘Linear’?