nncf/experimental/torch/nas/bootstrapNAS/elasticity/elastic_width.py
def forward(self, weight: torch.Tensor, bias: Optional[torch.Tensor]) -> List[torch.Tensor]:
        """
        Trims convolution parameters according to active number of output channels.

        :param weight: weight tensor to be trimmed
        :param bias: bias tensor to be trimmed
        :return: list of trimmed convolution parameters
        """
        nncf_logger.debug('Conv2d with active width={} in scope={}'.format(self._active_width, self._node_name))
        num_out_channels = self._active_width
        new_bias = None if bias is None else bias[:num_out_channels]
        new_weights = weight[:num_out_channels, :, :, :]
        return [new_weights, new_bias]

        Trims convolution parameters according to active number of output channels.

        :param weight: weight tensor to be trimmed
        :param bias: bias tensor to be trimmed
        :return: list of trimmed convolution parameters
        
Trims convolution parameters according to active number of output channels.
Trims convolution parameters according to active number of output channels .
def forward(self, weight: torch.Tensor, bias: Optional[torch.Tensor]) -> List[torch.Tensor]:
        nncf_logger.debug('Conv2d with active width={} in scope={}'.format(self._active_width, self._node_name))
        num_out_channels = self._active_width
        new_bias = None if bias is None else bias[:num_out_channels]
        new_weights = weight[:num_out_channels, :, :, :]
        return [new_weights, new_bias]
def forward ( self , weight : torch . Tensor , bias : Optional [ torch . Tensor ] ) -> List [ torch . Tensor ] : nncf_logger . debug ( 'Conv2d with active width={} in scope={}' . format ( self . _active_width , self . _node_name ) ) num_out_channels = self . _active_width new_bias = None if bias is None else bias [ : num_out_channels ] new_weights = weight [ : num_out_channels , : , : , : ] return [ new_weights , new_bias ]
Trims convolution parameters according to active number of output channels.
Trims convolution parameters according to active number of output channels .
"""
        Trims convolution parameters according to active number of output channels.

        :param weight: weight tensor to be trimmed
        :param bias: bias tensor to be trimmed
        :return: list of trimmed convolution parameters
        """
list of trimmed convolution parameters
list of trimmed convolution parameters
self
weight
torch.Tensor
weight tensor to be trimmed
weight tensor to be trimmed
bias
Optional[torch.Tensor]
bias tensor to be trimmed
bias tensor to be trimmed