[fix] jacrev and jacfwd : support non-tensor args again (#97746) (#97908)
Fixes https://github.com/pytorch/pytorch/issues/97636
The code to check if argument tensor are complex assumed that all arguments are tensor (which is not the case) which lead to the error.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97746
Approved by: https://github.com/zou3519