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

Method to_static

src/shape.cpp:628–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628shape shape::to_static(std::size_t x) const
629{
630 if(not sub_shapes().empty())
631 {
632 std::vector<shape> subs;
633 std::transform(sub_shapes().cbegin(),
634 sub_shapes().cend(),
635 std::back_inserter(subs),
636 [&](auto s) { return s.to_static(x); });
637 return shape(subs);
638 }
639 if(not this->dynamic())
640 {
641 return *this;
642 }
643 auto static_lens = this->max_lens();
644 std::transform(static_lens.begin(),
645 static_lens.end(),
646 this->dyn_dims().cbegin(),
647 static_lens.begin(),
648 [&](auto sl, const auto& dd) { return dd.is_fixed() ? sl : x; });
649 return {type(), static_lens};
650}
651
652std::size_t shape::element_space() const { return impl->element_space(); }
653

Callers 6

TEST_CASEFunction · 0.80
applyMethod · 0.80
applyMethod · 0.80
generateMethod · 0.80
handle_inputsMethod · 0.80
parse_static_splitFunction · 0.80

Calls 9

dynamicMethod · 0.95
max_lensMethod · 0.95
typeFunction · 0.85
is_fixedMethod · 0.80
transformFunction · 0.50
shapeFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TEST_CASEFunction · 0.64