[JIT] Optimize FunctionSchema::checkArg for the Tensor case. (#48034)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48034
The Tensor case is one of the most common and the existing check can be
made faster. This results in a ~21% improvement on DeepAndWide model and
would improve other models as well.
Before the change:
```
505[ms]
491[ms]
514[ms]
538[ms]
514[ms]
554[ms]
556[ms]
512[ms]
516[ms]
527[ms]
```
After the change:
```
406[ms]
394[ms]
414[ms]
423[ms]
449[ms]
397[ms]
410[ms]
389[ms]
395[ms]
414[ms]
```
Differential Revision: D24999486
Test Plan: Imported from OSS
Reviewed By: zdevito
Pulled By: ZolotukhinM
fbshipit-source-id: 7139a3a38f9c44e8ea793afe2fc662ff51cc0460
Author
Mikhail Zolotukhin