Device check will be automatically generated for functions

With #56872 landed, now functions registered in native_functions.yaml will have automatically generated check about whether tensor parameters are on the same devices by default.

If your function allows tensors on different devices (e.g. using TensorIterator ), you can set device_check: NoCheck explicitly in native_functions.yaml . See also…/tree/master/aten/src/ATen/native…


Many functions check whether the tensor parameters are on the same device with a few different implementations, which cause code duplications and confusions:

This is a first step towards unifying device check code.