(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 type(m) in self.layer_types and not hasattr(
                    m, 'condensa_nocompress'):
                vec.append(m.weight.data.view(-1))
        return T.threshold(torch.cat(vec), self.density)
def threshold ( self , module ) : vec = [ ] for m in module . modules ( ) : if type ( m ) in self . layer_types and not hasattr ( m , 'condensa_nocompress' ) : vec . append ( m . weight . data . view ( - 1 ) ) return T . threshold ( torch . cat ( vec ) , self . density )