(self, x)
return layers
Forward this model.

        Args:
            x (chainer.Variable or array): Input to the model.

        Returns:
            chainer.Variable or tuple of chainer.Variable:
            The returned layers are determined by :obj:`pick`.
Forward this model.
Forward this model .
def forward(self, x):
        """Forward this model.

        Args:
            x (chainer.Variable or array): Input to the model.

        Returns:
            chainer.Variable or tuple of chainer.Variable:
            The returned layers are determined by :obj:`pick`.

        """
        if self._pick is None:
            pick = (self.layer_names[-1],)
        else:
            pick = self._pick

        # The biggest index among indices of the layers that are included
        # in pick.
        last_index = max(self.layer_names.index(name) for name in pick)

        layers = {}
        h = x
        for name in self.layer_names[:last_index + 1]:
            h = self[name](h)
            if name in pick:
                layers[name] = h

        if self._return_tuple:
            layers = tuple(layers[name] for name in pick)
        else:
            layers = list(layers.values())[0]
        return layers
def forward ( self , x ) : if self . _pick is None : pick = ( self . layer_names [ - 1 ] , ) else : pick = self . _pick # The biggest index among indices of the layers that are included # in pick. last_index = max ( self . layer_names . index ( name ) for name in pick ) layers = { } h = x for name in self . layer_names [ : last_index + 1 ] : h = self [ name ] ( h ) if name in pick : layers [ name ] = h if self . _return_tuple : layers = tuple ( layers [ name ] for name in pick ) else : layers = list ( layers . values ( ) ) [ 0 ] return layers