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

Method ReduceToColArray2D

tensorflow/compiler/xla/reference_util.cc:504–519  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

502}
503
504/* static */ std::unique_ptr<std::vector<float>>
505ReferenceUtil::ReduceToColArray2D(
506 const Array2D<float>& matrix, float init,
507 const std::function<float(float, float)>& reduce_function) {
508 int64 rows = matrix.height();
509 int64 cols = matrix.width();
510 auto result = absl::make_unique<std::vector<float>>();
511 for (int64 i = 0; i < rows; ++i) {
512 float acc = init;
513 for (int64 j = 0; j < cols; ++j) {
514 acc = reduce_function(acc, matrix(i, j));
515 }
516 result->push_back(acc);
517 }
518 return result;
519}
520
521/* static */ std::unique_ptr<std::vector<float>>
522ReferenceUtil::ReduceToRowArray2D(

Callers

nothing calls this directly

Calls 4

matrixFunction · 0.85
heightMethod · 0.45
widthMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected