class_docstr: This class is a MockSparseLinear class to check convert functionality.
  It is the same as a normal Linear layer, except with a different type, as
  well as an additional from_dense method.
class_docstr_tok: ["This","class","is","a","MockSparseLinear","class","to","check","convert","functionality",".","It","is","the","same","as","a","normal","Linear","layer",",","except","with","a","different","type",",","as","well","as","an","additional","from_dense","method","."]
docstr_tok: []
code: def from_dense(cls, mod):
      """ """
      linear = cls(mod.in_features, mod.out_features)
      return linear
  
imports: from torch.ao.pruning import BaseSparsifier
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 for calling the MockSparseLinear obj's underlying member method code with example usage: obj.from_dense(cls, mod) and returns: linear