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

Method replace_return

src/module.cpp:598–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598instruction_ref module::replace_return(std::vector<instruction_ref> args)
599{
600 impl->changed.notify();
601 auto last = std::prev(this->end());
602 // If there is no return then add a return
603 if(last->name() != "@return")
604 {
605 assert(std::none_of(impl->instructions.begin(),
606 impl->instructions.end(),
607 [](const instruction& ins) { return ins.name() == "@return"; }));
608 return this->add_return(args);
609 }
610
611 shape r = compute_shape(last->get_operator(), args);
612 instruction::replace(last, last->get_operator(), r, std::move(args));
613 assert(last->valid(begin()));
614
615 return last;
616}
617
618shape module::get_parameter_shape(std::string name) const
619{

Callers 10

applyMethod · 0.80
append_pointwise_moduleFunction · 0.80
preserve_output_layoutFunction · 0.80
applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
offload_to_mlirFunction · 0.80
applyMethod · 0.80
MIGRAPHX_PYBIND11_MODULEFunction · 0.80
modify_bodyMethod · 0.80

Calls 10

endMethod · 0.95
add_returnMethod · 0.95
replaceFunction · 0.85
beginFunction · 0.85
notifyMethod · 0.80
compute_shapeFunction · 0.70
none_ofFunction · 0.50
nameMethod · 0.45
beginMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected