MCPcopy
hub / github.com/dmlc/dgl / __init__

Method __init__

examples/pytorch/dtgrnn/model.py:71–86  ·  view source on GitHub ↗
(self, in_feats, out_feats, num_layers, net)

Source from the content-addressed store, hash-verified

69 """
70
71 def __init__(self, in_feats, out_feats, num_layers, net):
72 super(StackedEncoder, self).__init__()
73 self.in_feats = in_feats
74 self.out_feats = out_feats
75 self.num_layers = num_layers
76 self.net = net
77 self.layers = nn.ModuleList()
78 if self.num_layers <= 0:
79 raise DGLError("Layer Number must be greater than 0! ")
80 self.layers.append(
81 GraphGRUCell(self.in_feats, self.out_feats, self.net)
82 )
83 for _ in range(self.num_layers - 1):
84 self.layers.append(
85 GraphGRUCell(self.out_feats, self.out_feats, self.net)
86 )
87
88 # hidden_states should be a list which for different layer
89 def forward(self, g, x, hidden_states):

Callers

nothing calls this directly

Calls 4

DGLErrorClass · 0.90
GraphGRUCellClass · 0.85
appendMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected