MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / broadcastOut

Function broadcastOut

test/binary.cpp:651–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649/// clang-format on
650
651af::dim4 broadcastOut(dim4 lhs, dim4 rhs) {
652 dim4 out(1);
653 for (int i = 0; i < AF_MAX_DIMS; i++) {
654 if (lhs[i] == rhs[i])
655 out[i] = lhs[i];
656 else if (lhs[i] == 1 && rhs[i] > 1)
657 out[i] = rhs[i];
658 else if (lhs[i] > 1 && rhs[i] == 1)
659 out[i] = lhs[i];
660 else {
661 std::cout << "incorrect dimension" << lhs << " op " << rhs;
662 return dim4(0);
663 }
664 }
665 return out;
666}
667
668af::dim4 tileRepeations(dim4 in, dim4 other) {
669 af::dim4 out;

Callers 1

TEST_PFunction · 0.85

Calls 1

dim4Class · 0.50

Tested by

no test coverage detected