MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / add_input_layout_constraint

Method add_input_layout_constraint

src/opr/impl/io.cpp:763–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

761#endif
762
763void Copy::add_input_layout_constraint() {
764 if (input(0)->comp_node() != output(0)->comp_node()) {
765 auto check = [this](const TensorLayout& layout) {
766 auto handle = intl::get_megdnn_handle(this->comp_node());
767 return handle->check_cross_dev_copy_constraint(layout);
768 };
769 input(0)->add_layout_constraint(check);
770 }
771}
772
773void Copy::init_output_static_infer_desc() {
774 using namespace cg::static_infer;

Callers

nothing calls this directly

Calls 3

add_layout_constraintMethod · 0.80
comp_nodeMethod · 0.45

Tested by

no test coverage detected