MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / transposed

Method transposed

src/shape.cpp:519–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519bool shape::transposed() const
520{
521 if(this->dynamic())
522 {
523 return false;
524 }
525 if(this->broadcasted())
526 {
527 // TODO: Use a filter_iterator instead
528 std::vector<std::size_t> s;
529 s.reserve(this->strides().size());
530 std::copy_if(this->strides().begin(),
531 this->strides().end(),
532 std::back_inserter(s),
533 [](std::size_t x) { return x != 0; });
534 return not std::is_sorted(s.rbegin(), s.rend());
535 }
536 else
537 {
538 return not std::is_sorted(this->strides().rbegin(), this->strides().rend());
539 }
540}
541
542bool shape::broadcasted() const
543{

Callers 6

TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
applyMethod · 0.45
applyMethod · 0.45

Calls 7

dynamicMethod · 0.95
broadcastedMethod · 0.95
copy_ifFunction · 0.50
is_sortedFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 4

TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36