FX graph module - prevent infinite recursion (#73866)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73866
super(type(self), self) in wrapped_call leads to infinite recursion for subclass of Fx graph module. This happens when we call _stateless.functional_call on a fx module. https://github.com/pytorch/pytorch/blob/master/torch%2Fnn%2Futils%2F_stateless.py
Test Plan:
Tests added in https://github.com/pytorch/pytorch/pull/62436
Imported from OSS
Reviewed By: jansel
Differential Revision: D34737828
fbshipit-source-id: 871b897e1210173ccc83fe34d53fc41af00a39ee
(cherry picked from commit 3d0c5fc71503fa2782b497a9d39ce26288fd219b)