fn
reduce_output_shape
→Shapeint reduce_output_shape(const int & input_shape, const int & axes, bool keepdims)Compute the output shape of a reduction over selected axes.
Reduced dimensions are removed by default; passing keepdims=true
leaves them in place as size-1 axes (matching reference-framework
semantics) so the result broadcasts cleanly against the input.
Parameters
input_shapeconst Shape&Shape of the tensor being reduced.
axesconst std::vector<int>&Pre-normalised axis list (see
normalize_axes).keepdimsboolWhether to retain reduced axes as size 1.
Returns
ShapeResulting shape after the reduction.