code: def _run_on_loss(self, net, param_init_net, param, grad=None):
      output_blob = net.NextScopedBlob(
          param + "_elastic_net_l1_trimmed_regularization"
      )
      l2_blob = net.NextScopedBlob(param + "_l2_blob")
      net.LpNorm([param], [l2_blob], p=2)
      net.Scale([l2_blob], [l2_blob], scale=self.l2)
  
      l1_blob = net.NextScopedBlob(param + "_l1_blob")
      abs = net.Abs([param], [net.NextScopedBlob("abs")])
      sum_abs = net.SumElements(
          [abs], [net.NextScopedBlob("sum_abs")], average=False
      )
      topk, _, _ = net.TopK(
          [abs],
          [
              net.NextScopedBlob("topk"),
              net.NextScopedBlob("id"),
              net.NextScopedBlob("flat_id"),
          ],
          k=self.k,
      )
      topk_sum = net.SumElements(
          [topk], [net.NextScopedBlob("topk_sum")], average=False
      )
      net.Sub([sum_abs, topk_sum], [l1_blob])
      net.Scale([l1_blob], [l1_blob], scale=self.l1)
  
      net.Add([l1_blob, l2_blob], [output_blob])
      return output_blob
  
imports: from caffe2.python import core, utils
  import numpy
label_desc: Use image node_id 2 for calling the ElasticNetL1NormTrimmed obj's underlying member method code with example usage: obj._run_on_loss(net, param_init_net, param, grad) and returns: output_blob