He didnt have formal training in math. So where did his subconscious "learn" the advanced stuff in his visions?
As an atheist myself, I do not believe in god and I do not believe Ramanujam got it from god. However, it does not change the fact Ramanujan thought he got it from god because he could not necessarily explain how he made those intuitive leaps.