class_docstr: A module that wraps another layer in which some weights will be replaced by 0 during training.
class_docstr_tok: ["A","module","that","wraps","another","layer","in","which","some","weights","will","be","replaced","by","0","during","training","."]
docstr: Apply dropout to the raw weights.
docstr_tok: ["Apply","dropout","to","the","raw","weights","."]
code: def _setweights(self):
      "Apply dropout to the raw weights."
      for layer in self.layer_names:
          raw_w = getattr(self, f"{layer}_raw")
          if self.training:
              w = F.dropout(raw_w, p=self.weight_p)
          else:
              w = raw_w.clone()
          setattr(self.module, layer, w)
  
imports: from __future__ import annotations
  from ...data.all import *
  from ..core import *
label_desc: Use image node_id 2 for calling the WeightDropout obj's underlying member method code with example usage: obj._setweights() without return types