def forward_cpu(self, inputs):
x, W = inputs[:2]
n_batch, c_in, N = x.shape
b = inputs[2] if len(inputs) == 3 else None
K = self.K
if x.dtype != self.LmI.dtype:
self.LmI = self.LmI.astype(x.dtype)
C = np.empty((n_batch, K, N, c_in), dtype=x.dtype)
chebyshev_matvec_cpu(C, x, K, n_batch, self.LmI)
C = C.transpose((0, 3, 1, 2))
self.C = C
y = np.tensordot(C, W, ((1, 2), (1, 2)))
if b is not None:
y += b
return np.rollaxis(y, 2, 1), # y.shape = (n_batch, c_out, N)
graph_convolution.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录