nncf/experimental/torch/nas/bootstrapNAS/elasticity/elastic_kernel.py
def forward(self, weight: torch.Tensor) -> torch.Tensor:
        """
        Modifies weight to have kernel size equals to active kernel size value.

        :param weight: weight tensor to be modified
        :return: modified weight
        """
        kernel_size = self.get_active_kernel_size()
        nncf_logger.debug('Conv2d with active kernel size={} in scope={}'.format(kernel_size, self.node_name))

        result = weight
        if is_tracing_state():
            with no_jit_trace():
                if kernel_size > 1:
                    result = self._get_active_filter(kernel_size, weight).detach()
        else:
            if kernel_size > 1:
                result = self._get_active_filter(kernel_size, weight)
        return result

        Modifies weight to have kernel size equals to active kernel size value.

        :param weight: weight tensor to be modified
        :return: modified weight
        
Modifies weight to have kernel size equals to active kernel size value.
Modifies weight to have kernel size equals to active kernel size value .
def forward(self, weight: torch.Tensor) -> torch.Tensor:
        kernel_size = self.get_active_kernel_size()
        nncf_logger.debug('Conv2d with active kernel size={} in scope={}'.format(kernel_size, self.node_name))
        result = weight
        if is_tracing_state():
            with no_jit_trace():
                if kernel_size > 1:
                    result = self._get_active_filter(kernel_size, weight).detach()
        else:
            if kernel_size > 1:
                result = self._get_active_filter(kernel_size, weight)
        return result
def forward ( self , weight : torch . Tensor ) -> torch . Tensor : kernel_size = self . get_active_kernel_size ( ) nncf_logger . debug ( 'Conv2d with active kernel size={} in scope={}' . format ( kernel_size , self . node_name ) ) result = weight if is_tracing_state ( ) : with no_jit_trace ( ) : if kernel_size > 1 : result = self . _get_active_filter ( kernel_size , weight ) . detach ( ) else : if kernel_size > 1 : result = self . _get_active_filter ( kernel_size , weight ) return result
Modifies weight to have kernel size equals to active kernel size value.
Modifies weight to have kernel size equals to active kernel size value .
"""
        Modifies weight to have kernel size equals to active kernel size value.

        :param weight: weight tensor to be modified
        :return: modified weight
        """
None
self
weight
torch.Tensor
weight tensor to be modified
weight tensor to be modified