| 34 | } |
| 35 | |
| 36 | cg::OperatorNodeBase* apply_on_var_node_remote_recv( |
| 37 | const OpDef& def, const VarNodeArray& inputs) { |
| 38 | auto&& recv = def.cast_final_safe<RemoteRecv>(); |
| 39 | OperatorNodeConfig config{recv.cn}; |
| 40 | config.name(recv.make_name()); |
| 41 | auto group_client = std::make_shared<opr::GroupClientProxy>( |
| 42 | ssprintf("%s:%d", recv.addr.data(), recv.port)); |
| 43 | auto&& graph = inputs[0]->owner_graph(); |
| 44 | mgb_assert(!recv.shape.empty()); |
| 45 | TensorShape shape; |
| 46 | for (auto&& dim : recv.shape) { |
| 47 | shape[shape.ndim++] = dim; |
| 48 | } |
| 49 | return graph->insert_opr(std::make_unique<mgb::opr::RemoteRecv>( |
| 50 | recv.key, inputs[0], *graph, group_client, config, shape, recv.dtype, |
| 51 | recv.backend)); |
| 52 | } |
| 53 | |
| 54 | TensorPtr megray_recv_tensor( |
| 55 | std::shared_ptr<MegRay::Communicator> megray_comm, TensorLayout& layout, |
nothing calls this directly
no test coverage detected