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

Method MapArray2D

tensorflow/compiler/xla/reference_util.cc:634–646  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

632}
633
634/* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapArray2D(
635 const Array2D<float>& matrix,
636 const std::function<float(float)>& map_function) {
637 int64 rows = matrix.height();
638 int64 cols = matrix.width();
639 auto result = absl::make_unique<Array2D<float>>(rows, cols);
640 for (int64 i = 0; i < rows; ++i) {
641 for (int64 j = 0; j < cols; ++j) {
642 (*result)(i, j) = map_function(matrix(i, j));
643 }
644 }
645 return result;
646}
647
648/* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapArray2D(
649 const Array2D<float>& lhs, const Array2D<float>& rhs,

Callers

nothing calls this directly

Calls 3

matrixFunction · 0.85
heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected