(
        self, x: Tensor, depth: int, alpha: float, labels: Optional[Tensor] = None
    )
return y
forward pass of the discriminator
        Args:
            x: input to the network
            depth: current depth of operation (Progressive GAN)
            alpha: current value of alpha for fade-in
            labels: labels for conditional discriminator (Default = None)
                    shape => (Batch_size,) shouldn't be a column vector

        Returns: raw discriminator scores
forward pass of the discriminator
        Args:
            x: input to the network
            depth: current depth of operation (Progressive GAN)
            alpha: current value of alpha for fade-in
            labels: labels for conditional discriminator (Default = None)
                    shape => (Batch_size,) shouldn't be a column vector
forward pass of the discriminator Args : x : input to the network depth : current depth of operation ( Progressive GAN ) alpha : current value of alpha for fade - in labels : labels for conditional discriminator ( Default = None ) shape = > ( Batch_size ) shouldn t be a column vector
def forward(
        self, x: Tensor, depth: int, alpha: float, labels: Optional[Tensor] = None
    ) -> Tensor:
        """
        forward pass of the discriminator
        Args:
            x: input to the network
            depth: current depth of operation (Progressive GAN)
            alpha: current value of alpha for fade-in
            labels: labels for conditional discriminator (Default = None)
                    shape => (Batch_size,) shouldn't be a column vector

        Returns: raw discriminator scores
        """
        assert (
            depth <= self.depth
        ), f"Requested output depth {depth} cannot be evaluated"

        if self.conditional:
            assert labels is not None, "Conditional discriminator required labels"

        if depth > 2:
            residual = self.from_rgb[-(depth - 2)](
                avg_pool2d(x, kernel_size=2, stride=2)
            )
            straight = self.layers[-(depth - 1)](self.from_rgb[-(depth - 1)](x))
            y = (alpha * straight) + ((1 - alpha) * residual)
            for layer_block in self.layers[-(depth - 2) : -1]:
                y = layer_block(y)
        else:
            y = self.from_rgb[-1](x)
        if self.conditional:
            y = self.layers[-1](y, labels)
        else:
            y = self.layers[-1](y)
        return y
def forward ( self , x : Tensor , depth : int , alpha : float , labels : Optional [ Tensor ] = None ) -> Tensor : assert ( depth <= self . depth ) , f"Requested output depth {depth} cannot be evaluated" if self . conditional : assert labels is not None , "Conditional discriminator required labels" if depth > 2 : residual = self . from_rgb [ - ( depth - 2 ) ] ( avg_pool2d ( x , kernel_size = 2 , stride = 2 ) ) straight = self . layers [ - ( depth - 1 ) ] ( self . from_rgb [ - ( depth - 1 ) ] ( x ) ) y = ( alpha * straight ) + ( ( 1 - alpha ) * residual ) for layer_block in self . layers [ - ( depth - 2 ) : - 1 ] : y = layer_block ( y ) else : y = self . from_rgb [ - 1 ] ( x ) if self . conditional : y = self . layers [ - 1 ] ( y , labels ) else : y = self . layers [ - 1 ] ( y ) return y