| 326 | } |
| 327 | |
| 328 | of::Maybe<void> Graph::GraphImpl::AddOp(of::OperatorConf op_conf) { |
| 329 | { |
| 330 | const std::shared_ptr<of::Scope> scope = JUST(of::GetCurrentScope()); |
| 331 | op_conf.set_scope_symbol_id(scope->symbol_id().value_or(0)); |
| 332 | } |
| 333 | op_conf.set_device_tag(GetDeviceTag(device_)); |
| 334 | if (batch_size_ > 0 && op_conf.has_input_conf()) { |
| 335 | op_conf.mutable_input_conf()->mutable_blob_conf()->mutable_shape()->mutable_dim()->Set( |
| 336 | 0, batch_size_); |
| 337 | } |
| 338 | auto* ctx = JUST(of::GetCurInferCtx()); |
| 339 | JUST(ctx->AddAndInferGlobalOp(op_conf)); |
| 340 | return of::Maybe<void>::Ok(); |
| 341 | } |
| 342 | |
| 343 | of::Maybe<void> Graph::GraphImpl::BuildGraph() { |
| 344 | CompileScope build_graph_scope(job_.job_conf(), *device_.device_->shared_from_symbol()); |
nothing calls this directly
no test coverage detected