def __call__(self, x): """Applies the depthwise convolution layer. Args: x (chainer.Variable or :class:`numpy.ndarray` or cupy.ndarray): Input image. Returns: ~chainer.Variable: Output of the depthwise convolution. """ if self.W.data is None: self._initialize_params(x.shape[1]) return depthwise_convolution_2d.depthwise_convolution_2d( x, self.W, self.b, self.stride, self.pad)
def forward(self, x): """Applies the depthwise convolution layer. Args: x (chainer.Variable or :class:`numpy.ndarray` or cupy.ndarray): Input image. Returns: ~chainer.Variable: Output of the depthwise convolution. """ if self.W.array is None: self._initialize_params(x.shape[1]) return depthwise_convolution_2d.depthwise_convolution_2d( x, self.W, self.b, self.stride, self.pad)
def __call__(self, x): """Applies the depthwise convolution layer. Args: x (chainer.Variable or :class:`numpy.ndarray` or cupy.ndarray): Input image. Returns: ~chainer.Variable: Output of the depthwise convolution. """ if self.has_uninitialized_params: with cuda.get_device_from_id(self._device_id): self._initialize_params(x.shape[1]) return depthwise_convolution_2d.depthwise_convolution_2d( x, self.W, self.b, self.stride, self.pad)
def __call__(self, x): """Applies the depthwise convolution layer. Args: x (chainer.Variable or :class:`numpy.ndarray` or cupy.ndarray): Input image. Returns: ~chainer.Variable: Output of the depthwise convolution. """ if self.has_uninitialized_params: with cuda.get_device(self._device_id): self._initialize_params(x.shape[1]) return depthwise_convolution_2d.depthwise_convolution_2d( x, self.W, self.b, self.stride, self.pad)
def __call__(self, x): if self.W.data is None: self._initialize_params(x.shape[1]) return depthwise_convolution_2d.depthwise_convolution_2d( x, self.W_bar, self.b, self.stride, self.pad)