MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _may_reduce_to_scalar

Function _may_reduce_to_scalar

tensorflow/python/ops/math_ops.py:1454–1459  ·  view source on GitHub ↗

Set a reduction's output shape to be a scalar if we are certain.

(keepdims, axis, output)

Source from the content-addressed store, hash-verified

1452
1453
1454def _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"])

Callers 9

reduce_sumFunction · 0.85
reduce_euclidean_normFunction · 0.85
reduce_meanFunction · 0.85
reduce_prodFunction · 0.85
reduce_minFunction · 0.85
reduce_maxFunction · 0.85
reduce_allFunction · 0.85
reduce_anyFunction · 0.85
reduce_logsumexpFunction · 0.85

Calls 1

set_shapeMethod · 0.45

Tested by

no test coverage detected