def _may_reduce_to_scalar(keepdims, axis, output):
    "Set a reduction's output shape to be a scalar if we are certain."
    if ((not common_shapes.has_fully_defined_shape(output)) and (not keepdims) and (axis is None)):
        output.set_shape(())
    return output
Set a reduction's output shape to be a scalar if we are certain.
def _may_reduce_to_scalar(keepdims, axis, output):
    
    if ((not common_shapes.has_fully_defined_shape(output)) and (not keepdims) and (axis is None)):
        output.set_shape(())
    return output