from tensorflow.python.ops import math_ops

        grad = ops.IndexedSlices(grad_values, grad.indices, grad.dense_shape)
      else:
        grad *= math_ops.cast(multiplier, grad.dtype)
    multiplied_grads_and_vars.append((grad, var))
