Example #1
0
    def forward(self, volatile='off'):
        """Returns the parameter variable.

        Args:
            volatile (~chainer.Flag): The volatility of the returned variable.

        Returns:
            ~chainer.Variable: A copy of the parameter variable with given
            volatility.

        """
        # The first identity creates a copy of W, and the second identity cuts
        # the edge if volatility is ON
        W = identity.identity(self.W)
        W.volatile = volatile
        return identity.identity(W)
    def __call__(self, volatile='off'):
        """Returns the parameter variable.

        Args:
            volatile (~chainer.Flag): The volatility of the returned variable.

        Returns:
            ~chainer.Variable: A copy of the parameter variable with given
            volatility.

        """
        # The first identity creates a copy of W, and the second identity cuts
        # the edge if volatility is ON
        W = identity.identity(self.W)
        W.volatile = volatile
        return identity.identity(W)