def __call__(self, x):
"""Applies the linear layer.
Args:
x (~chainer.Variable): Batch of input vectors.
Returns:
~chainer.Variable: Output of the linear layer.
"""
if self.has_uninitialized_params:
with cuda.get_device(self._device_id):
self._initialize_params(x.size // x.shape[0])
return linear.linear(x, self.W, self.b)
评论列表
文章目录