Thanks for your reply. I want to perform computation in FP16 directly. I have found the solution which is AT_DISPATCH_FLOATING_TYPES_AND(at::ScalarType::Half, ...), which seems to be better considering that DISPATCH_DOUBLE_FLOAT_AND_HALF is being deprecated.