#include "ATen/ATen.h" #include template T *data_ptr(torch::Tensor x) { return x.data_ptr(); } template <> inline half *data_ptr(torch::Tensor x) { return reinterpret_cast(x.data_ptr()); }