(
        self, x: Tensor, depth: Optional[int] = None, alpha: float = 1.0
    )
return y
forward pass of the Generator
        Args:
            x: input latent noise
            depth: depth from where the network's output is required
            alpha: value of alpha for fade-in effect

        Returns: generated images at the give depth's resolution
forward pass of the Generator
        Args:
            x: input latent noise
            depth: depth from where the network's output is required
            alpha: value of alpha for fade-in effect
forward pass of the Generator Args : x : input latent noise depth : depth from where the network s output is required alpha : value of alpha for fade - in effect
def forward(
        self, x: Tensor, depth: Optional[int] = None, alpha: float = 1.0
    ) -> Tensor:
        """
        forward pass of the Generator
        Args:
            x: input latent noise
            depth: depth from where the network's output is required
            alpha: value of alpha for fade-in effect

        Returns: generated images at the give depth's resolution
        """
        depth = self.depth if depth is None else depth
        assert depth <= self.depth, f"Requested output depth {depth} cannot be produced"

        if depth == 2:
            y = self.rgb_converters[0](self.layers[0](x))
        else:
            y = x
            for layer_block in self.layers[: depth - 2]:
                y = layer_block(y)
            residual = interpolate(self.rgb_converters[depth - 3](y), scale_factor=2)
            straight = self.rgb_converters[depth - 2](self.layers[depth - 2](y))
            y = (alpha * straight) + ((1 - alpha) * residual)
        return y
def forward ( self , x : Tensor , depth : Optional [ int ] = None , alpha : float = 1.0 ) -> Tensor : depth = self . depth if depth is None else depth assert depth <= self . depth , f"Requested output depth {depth} cannot be produced" if depth == 2 : y = self . rgb_converters [ 0 ] ( self . layers [ 0 ] ( x ) ) else : y = x for layer_block in self . layers [ : depth - 2 ] : y = layer_block ( y ) residual = interpolate ( self . rgb_converters [ depth - 3 ] ( y ) , scale_factor = 2 ) straight = self . rgb_converters [ depth - 2 ] ( self . layers [ depth - 2 ] ( y ) ) y = ( alpha * straight ) + ( ( 1 - alpha ) * residual ) return y