parameters: (x, axis, dout)
return_statement: return tile(grad, tile_scaling)
docstring: Grad definition for `Sum` operation.
docstring_summary: Grad definition for `Sum` operation.
docstring_tokens: Grad definition for Sum operation .
function: def _sum_grad(x, axis, dout):
      """Grad definition for `Sum` operation."""
      input_shape = shape_op(x)
      if is_shape_unknown(input_shape):
          input_shape = dyn_shape_op(x)
          output_shape_kept_dims = _dyn_reduced_shape(input_shape, axis)
          grad = reshape(dout, output_shape_kept_dims)
          return DynamicBroadcastTo()(grad, input_shape)
  
      output_shape_kept_dims = reduced_shape(input_shape, axis)
      tile_scaling = tuple_div(input_shape, output_shape_kept_dims)
      grad = reshape(dout, output_shape_kept_dims)
      return tile(grad, tile_scaling)
function_tokens: def _sum_grad ( x , axis , dout ) : input_shape = shape_op ( x ) if is_shape_unknown ( input_shape ) : input_shape = dyn_shape_op ( x ) output_shape_kept_dims = _dyn_reduced_shape ( input_shape , axis ) grad = reshape ( dout , output_shape_kept_dims ) return DynamicBroadcastTo ( ) ( grad , input_shape ) output_shape_kept_dims = reduced_shape ( input_shape , axis ) tile_scaling = tuple_div ( input_shape , output_shape_kept_dims ) grad = reshape ( dout , output_shape_kept_dims ) return tile ( grad , tile_scaling )