MCPcopy
hub / github.com/THUDM/CogDL / inference

Method inference

examples/VRGCN/VRGCN.py:128–141  ·  view source on GitHub ↗
(self, x, adj)

Source from the content-addressed store, hash-verified

126
127 @torch.no_grad()
128 def inference(self, x, adj):
129 x = x.to(self._device)
130 origin_device = adj.device
131 adj = adj.to(self._device)
132 xs = [x]
133 for i in range(self.num_layers):
134 x = spmm(adj, x)
135 x = self.lins[i](x)
136 if i != self.num_layers - 1:
137 x = self.norms[i](x)
138 x = x.relu_()
139 xs.append(x)
140 adj = adj.to(origin_device)
141 return x, xs
142
143 @torch.no_grad()
144 def inference_batch(self, x, test_loader):

Callers 1

eval_full_propFunction · 0.45

Calls 2

spmmFunction · 0.90
toMethod · 0.45

Tested by

no test coverage detected