class_docstr: ResNet model.
class_docstr_tok: ["ResNet","model","."]
docstr: L2 weight decay loss.
docstr_tok: ["L2","weight","decay","loss","."]
code: def _decay(self):
      """L2 weight decay loss."""
      if self.decay_cost is not None:
          return self.decay_cost
  
      costs = []
      if self.device_name is None:
          for var in tf.trainable_variables():
              if var.op.name.find(r"DW") > 0:
                  costs.append(tf.nn.l2_loss(var))
      else:
          for layer in self.layers:
              for var in layer.params_device[self.device_name].values():
                  if (
                      isinstance(var, tf.Variable)
                      and var.op.name.find(r"DW") > 0
                  ):
                      costs.append(tf.nn.l2_loss(var))
  
      self.decay_cost = tf.multiply(
          self.hps.weight_decay_rate, tf.add_n(costs)
      )
      return self.decay_cost
  
imports: from collections import namedtuple
  import tensorflow
  import six
  from model import MLPnGPU
  from model import Conv2DnGPU
  from model import LinearnGPU
  from model import LayerNorm
label_desc: Use image node_id 11 for calling the ResNetTF obj's underlying member method code with example usage: obj._decay() and returns: self, self