We tested the implementation of different IMFs in our model for the chemical evolution of ellipticals, with the aim of reproducing the observed relations of [Fe/H] and [Mg/Fe] abundances with galaxy mass in a sample of early-type galaxies selected from the SPIDER-SDSS catalog. Abundances in the catalog were derived from averaged spectra, obtained by stacking individual spectra according to central velocity dispersion, as a proxy of galaxy mass. We tested initial mass functions already used in a previous work, as well as two new models, based on low-mass tapered (bimodal) IMFs, where the IMF becomes either (1) bottom-heavy in more massive galaxies, or (2) is time-dependent, switching from top-heavy to bottom-heavy in the course of galactic evolution. We found that observations could only be reproduced by models assuming either a constant, Salpeter IMF, or a time-dependent distribution, as other IMFs failed. We further tested the models by calculating their M/L ratios. We conclude that a constant, time-independent bottom-heavy IMF does not reproduce the data, especially the increase of the $[alpha/Fe]$ ratio with galactic stellar mass, whereas a variable IMF, switching from top to bottom-heavy, can match observations. For the latter models, the IMF switch always occurs at the earliest possible considered time, i.e. $t_{text{switch}}= 0.1$ Gyr.