[74e12a]: / gcn / csrc / GOF.h

Download this file

34 lines (28 with data), 800 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "cpu/vision.h"
#ifdef WITH_CUDA
#include "cuda/vision.h"
#endif
// Interface for Python
at::Tensor GOF_forward(const at::Tensor& weight,
const at::Tensor& gaborFilterBank) {
if (weight.type().is_cuda()) {
#ifdef WITH_CUDA
return GOF_forward_cuda(weight, gaborFilterBank);
#else
AT_ERROR("Not compiled with GPU support");
#endif
}
return GOF_forward_cpu(weight, gaborFilterBank);
}
at::Tensor GOF_backward(const at::Tensor& grad_output,
const at::Tensor& gaborFilterBank) {
if (grad_output.type().is_cuda()) {
#ifdef WITH_CUDA
return GOF_backward_cuda(grad_output, gaborFilterBank);
#else
AT_ERROR("Not compiled with GPU support");
#endif
}
return GOF_backward_cpu(grad_output, gaborFilterBank);
}