class_docstr: A PackNet module that has a weight and bias. This can be used to wrap
  many PyTorch modules such as `nn.Linear`, `nn.Conv2d` and `nn.ConvTranspose2d`
class_docstr_tok: ["A","PackNet","module","that","has","a","weight","and","bias",".","This","can","be","used","to","wrap","many","PyTorch","modules","such","as","`","nn.Linear","`",",","`","nn.Conv2d","`","and","`","nn.ConvTranspose2d","`"]
docstr: Returns a 1D tensor of the weights ranked based on their absolute value.
  Sorted to be in ascending order.
docstr_tok: ["Returns","a","1D","tensor","of","the","weights","ranked","based","on","their","absolute","value",".","Sorted","to","be","in","ascending","order","."]
code: def _rank_prunable(self) -> Tensor:
      """
      Returns a 1D tensor of the weights ranked based on their absolute value.
      Sorted to be in ascending order.
      """
      # "We use the simple heuristic to quantify the importance of the
      # weights using their absolute value." (Han et al., 2017)
      # Han, S., Pool, J., Narang, S., Mao, H., Gong, E., Tang, S., Elsen, E.,
      # Vajda, P., Paluri, M., Tran, J., Catanzaro, B., & Dally, W. J. (2017).
      # DSD: Dense-Sparse-Dense Training for Deep Neural Networks.
      # ArXiv:1607.04381 [Cs]. http://arxiv.org/abs/1607.04381
      importance = self.wrappee.weight.abs()
      un_prunable = ~self.unfrozen_mask
      # Mark un-prunable weights using -1.0 so they can be cutout after sort
      importance[un_prunable] = -1.0
      rank = torch.argsort(importance.flatten())
      # Cut out un-prunable weights
      return rank[un_prunable.count_nonzero() :]
  
imports: import typing
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import functional
  from abc import ABC, abstractmethod
  from enum import Enum
  from avalanche.core import BaseSGDPlugin, Template
  from avalanche.models.dynamic_modules import MultiTaskModule
  from avalanche.models.simple_mlp import SimpleMLP
  from typing import Union
  from avalanche.training.templates.base_sgd import BaseSGDTemplate
label_desc: Use image node_id 9 for calling the WeightAndBiasPackNetModule obj's underlying member method code with example usage: obj._rank_prunable() and returns: rank