Set a reduction's output shape to be a scalar if we are certain.
(keepdims, axis, output)
| 1452 | |
| 1453 | |
| 1454 | def _may_reduce_to_scalar(keepdims, axis, output): |
| 1455 | """Set a reduction's output shape to be a scalar if we are certain.""" |
| 1456 | if not common_shapes.has_fully_defined_shape(output) and (not keepdims) and ( |
| 1457 | axis is None): |
| 1458 | output.set_shape(()) |
| 1459 | return output |
| 1460 | |
| 1461 | |
| 1462 | @tf_export(v1=["math.reduce_sum", "reduce_sum"]) |
no test coverage detected