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

Method MapWithIndexArray2D

tensorflow/compiler/xla/reference_util.cc:664–676  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

662}
663
664/* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapWithIndexArray2D(
665 const Array2D<float>& matrix,
666 const std::function<float(float, int64, int64)>& map_function) {
667 int64 rows = matrix.height();
668 int64 cols = matrix.width();
669 auto result = absl::make_unique<Array2D<float>>(rows, cols);
670 for (int64 i = 0; i < rows; ++i) {
671 for (int64 j = 0; j < cols; ++j) {
672 (*result)(i, j) = map_function(matrix(i, j), i, j);
673 }
674 }
675 return result;
676}
677
678} // namespace xla

Callers

nothing calls this directly

Calls 3

matrixFunction · 0.85
heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected