code: def scale(self, input, axis=1, num_axes=1, name=None):
      fluid = import_fluid()
  
      assert (
          num_axes == 1
      ), "layer scale not support this num_axes[%d] now" % (num_axes)
  
      prefix = name + "_"
      scale_shape = input.shape[axis : axis + num_axes]
      param_attr = fluid.ParamAttr(name=prefix + "scale")
      scale_param = fluid.layers.create_parameter(
          shape=scale_shape,
          dtype=input.dtype,
          name=name,
          attr=param_attr,
      )
  
      offset_attr = fluid.ParamAttr(name=prefix + "offset")
      offset_param = fluid.layers.create_parameter(
          shape=scale_shape,
          dtype=input.dtype,
          name=name,
          attr=offset_attr,
      )
  
      output = fluid.layers.elementwise_mul(
          input,
          scale_param,
          axis=axis,
          name=self.get_unique_output_name(name, "scale_mul"),
      )
      output = fluid.layers.elementwise_add(
          output,
          offset_param,
          axis=axis,
          name=self.get_unique_output_name(name, "scale_add"),
      )
      return output
  
imports: from __future__ import print_function
  from builtins import str
  from past.builtins import basestring
  from builtins import object
  import sys
  import os
  import math
  import numpy
label_desc: Use image node_id 26 for calling the Network obj's underlying member method code with example usage: obj.scale(input, axis, num_axes, name) and returns: output