human
Here's a good function header given the following:
I wrote the below code

    if (scale == 0.0):
        return tf.stop_gradient(net, name=name)
    elif (scale == 1.0):
        return tf.identity(net, name=name)
    else:
        scale_tensor = tf.convert_to_tensor(scale)
        @function.Defun(tf.float32, tf.float32, python_grad_func=(lambda op, g: ((g * op.inputs[1]), None)), func_name='ScaleGradient')
        def gradient_scaler(x, unused_scale):
            return x
        output = gradient_scaler(net, scale_tensor, name=name)
        output.set_shape(net.get_shape())
        return output

What's a good function header?
assistant
#Here's a good function header.

def scale_gradient(net, scale, name='scale_gradient'):