(self, module)
return T.threshold(torch.cat(vec), self.density)
Computes magnitude threshold.

        :param module: PyTorch module.
        :type module: `torch.nn.Module`
Computes magnitude threshold.
Computes magnitude threshold .
def threshold(self, module):
        """
        Computes magnitude threshold.

        :param module: PyTorch module.
        :type module: `torch.nn.Module`
        """
        vec = []
        for m in module.modules():
            if isinstance(m, torch.nn.Conv2d) and not hasattr(
                    m, 'condensa_nocompress'):
                agg = T.aggregate_filters(m.weight.data, self.criteria)
                vec.append(agg.view(-1))
        return T.threshold(torch.cat(vec), self.density)
def threshold ( self , module ) : vec = [ ] for m in module . modules ( ) : if isinstance ( m , torch . nn . Conv2d ) and not hasattr ( m , 'condensa_nocompress' ) : agg = T . aggregate_filters ( m . weight . data , self . criteria ) vec . append ( agg . view ( - 1 ) ) return T . threshold ( torch . cat ( vec ) , self . density )