| 128 | } // namespace |
| 129 | |
| 130 | void ExecNode::InferBlobDescsByInputs(const ParallelContext* parallel_ctx) { |
| 131 | auto GetBlobDesc4BnInOp = GetBlobDesc4BnInOpFunc(); |
| 132 | const OpNode* op_node = Singleton<OpGraph>::Get()->OpNode4OpName(op()->op_name()); |
| 133 | const NdSbpSignature* nd_sbp_signature = nullptr; |
| 134 | if (op_node != nullptr) { nd_sbp_signature = &op_node->nd_sbp_signature(); } |
| 135 | |
| 136 | if (op_node != nullptr && parallel_ctx->parallel_num() > 1 && nd_sbp_signature != nullptr) { |
| 137 | CHECK_JUST(CheckPhysicalBlobDesc( |
| 138 | *op(), op()->input_bns(), |
| 139 | std::bind(&Operator::GetLogicalBlobDesc4Ibn, op().get(), std::placeholders::_1), |
| 140 | nd_sbp_signature, parallel_ctx, GetBlobDesc4BnInOp)); |
| 141 | } |
| 142 | CHECK_JUST_MSG(op_->InferBlobDescsIf(GetBlobDesc4BnInOp, parallel_ctx, &GlobalJobDesc()), |
| 143 | std::stringstream() << " infer blob descs is failed, op name " << op_->op_loc()); |
| 144 | if (op_node != nullptr && parallel_ctx->parallel_num() > 1 && nd_sbp_signature != nullptr) { |
| 145 | CHECK_JUST(CheckPhysicalBlobDesc( |
| 146 | *op(), op()->output_bns(), |
| 147 | std::bind(&Operator::GetLogicalBlobDesc4Obn, op().get(), std::placeholders::_1), |
| 148 | nd_sbp_signature, parallel_ctx, GetBlobDesc4BnInOp)); |
| 149 | } |
| 150 | CHECK_JUST_MSG(op_->InferInplaceObn2IbnIf(&mut_inplace_obn2ibn_, &con_inplace_obn2ibn_, |
| 151 | GetBlobDesc4BnInOp, parallel_ctx), |
| 152 | std::stringstream() |
| 153 | << " infer inplace obn to ibn is failed, op name " << op_->op_loc()); |
| 154 | } |
| 155 | |
| 156 | void ExecNode::InferBlobDescsByNdSbp(const ParallelContext* parallel_ctx) { |
| 157 | const HashSet<std::string> ibns{op()->input_bns().begin(), op()->input_bns().end()}; |
nothing calls this directly
no test coverage detected