MCPcopy Create free account
hub / github.com/RenderKit/oidn / finalize

Method finalize

core/graph.cpp:462–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460 }
461
462 void Graph::finalize()
463 {
464 if (dirty)
465 planAllocs();
466
467 for (const auto& opTensorAllocPair : tensorAllocs)
468 {
469 auto& alloc = opTensorAllocPair.second;
470 const size_t byteOffset = tensorScratchPlanner.getAllocByteOffset(alloc->id);
471 alloc->tensor = scratch->newTensor(alloc->desc, tensorScratchByteOffset + byteOffset);
472 }
473
474 for (auto& lazyInit : lazyInits)
475 lazyInit();
476
477 for (auto& op : ops)
478 {
479 op->setScratch(scratch);
480 op->finalize();
481 }
482
483 cleanup();
484 constTensors.reset();
485 cachedConstTensors.reset();
486
487 finalized = true;
488 }
489
490 void Graph::submit(const Ref<Progress>& progress)
491 {

Callers 1

buildModelMethod · 0.45

Calls 3

newTensorMethod · 0.45
setScratchMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected