-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGCN.h
More file actions
34 lines (27 loc) · 667 Bytes
/
Copy pathGCN.h
File metadata and controls
34 lines (27 loc) · 667 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
33
34
/*
* @File : GCN.h
* @Time : 2022/07/21
* @Author : Han Hui
* @Contact : clearhanhui@gmail.com
*/
#include <torch/torch.h>
namespace nn = torch::nn;
namespace F = torch::nn::functional;
class GCNLayerImpl : public nn::Module {
public:
GCNLayerImpl(int in_features, int out_features);
torch::Tensor forward(torch::Tensor x, torch::Tensor a);
private:
torch::Tensor w;
torch::Tensor b;
};
TORCH_MODULE(GCNLayer); // 注册
class GCN : public nn::Module {
public:
GCN();
torch::Tensor forward(torch::Tensor x, torch::Tensor a);
private:
torch::nn::Dropout dropout = nullptr;
GCNLayer gc1 = nullptr;
GCNLayer gc2 = nullptr;
};