I'm trying to understand someone else's code in Python and I stumbled across a line I don't quite understand and which I can't find on the internet:
x=self(k)
with k being a torch-array. I know what self.something does but I haven't seen self(something) before.
selfis callable, indicating that this class may implement__call__magic method.selfis within ann.Module, then this calls the containing class'sforwardmethod (which is invoked from__call__as @MechanicPig points out).