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

Method __init__

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

Source from the content-addressed store, hash-verified

117 """
118
119 def __init__(self, in_feats, hid_feats, out_feats, num_layers, net):
120 super(StackedDecoder, self).__init__()
121 self.in_feats = in_feats
122 self.hid_feats = hid_feats
123 self.out_feats = out_feats
124 self.num_layers = num_layers
125 self.net = net
126 self.out_layer = nn.Linear(self.hid_feats, self.out_feats)
127 self.layers = nn.ModuleList()
128 if self.num_layers <= 0:
129 raise DGLError("Layer Number must be greater than 0!")
130 self.layers.append(GraphGRUCell(self.in_feats, self.hid_feats, net))
131 for _ in range(self.num_layers - 1):
132 self.layers.append(
133 GraphGRUCell(self.hid_feats, self.hid_feats, net)
134 )
135
136 def forward(self, g, x, hidden_states):
137 hiddens = []

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