Re 1: AT_DISPATCH_FLOATING_TYPES will do float and double automatically.
You specify the dispatch for the type of X. When you have an int-Tensor-argument Y, it’ll be the same. You cannot pass an int-Tensor as X here.
If you want half, there also is a _AND_HALF version.
Re 2: You don’t get any special treatment of these and would have to do it on your own.
Probably using backward in the second string is better.
Best regards
Thomas