1 #include <torch/extension.h> 6 void sigmoid_add_cuda(
const float* x,
const float* y,
float* output,
int size);
9 AT_CHECK(x.type().is_cuda(),
"x must be a CUDA tensor");
10 AT_CHECK(y.type().is_cuda(),
"y must be a CUDA tensor");
11 auto output = torch::zeros_like(x);
13 x.data<
float>(), y.data<
float>(), output.data<
float>(), output.numel());
17 PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
18 m.def(
"sigmoid_add", &sigmoid_add,
"sigmoid(x) + sigmoid(y)");