diff --git a/src/operator/PTQMetaOps.cpp b/src/operator/PTQMetaOps.cpp index 8febfd5ba0512dd88a83a37496b111ebd9a7c7ae..9a417154204b6e616978467c8a7c49d5f7f9fee1 100644 --- a/src/operator/PTQMetaOps.cpp +++ b/src/operator/PTQMetaOps.cpp @@ -119,7 +119,7 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl auto newMulNode = Mul(); auto roundNode = Round(); auto clipNode = Clip(""); //, clipMin, clipMax); - auto newCoeffNode = mulNode->getParent(1)->clone(); // UUU Producer(coeffTensor); + auto newCoeffNode = mulNode->getParent(1)->clone(); // XXX Producer(coeffTensor); // create the new micrograph @@ -130,9 +130,12 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl // manually connect the IOs !!! auto newMulOp = std::static_pointer_cast<OperatorTensor> (newMulNode->getOperator()); - newMulOp->setInput(0, mulOp->getInput(0)); // MANDATORY (because we need an input tensor) + newMulOp->associateInput(0, mulOp->getInput(0)); // MANDATORY (because we need an input tensor) auto clipOp = std::static_pointer_cast<Clip_Op> (clipNode->getOperator()); - clipOp->setOutput(0, mulOp->getOutput(0)); // MANDATORY ? YES !!! + clipOp->associateOutput(0, mulOp->getOutput(0)); // MANDATORY ? YES !!! + + // Log::notice( " old mul ref count : {}", mulOp->getOutput(0)->getImpl().use_count()); + // Log::notice( " new mul ref count : {}", newMulOp->getOutput(0)->getImpl().use_count()); // Connect the clip min and max tensors @@ -145,16 +148,15 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl newMicroGraph->add(minNode); newMicroGraph->add(maxNode); - // set backend + // set the backend/datatype newMicroGraph->setBackend(backend); newMicroGraph->setDataType(dataType); - + // reset the scheduling SequentialScheduler scheduler(newMicroGraph); scheduler.resetScheduling(); - //scheduler.generateScheduling(); // set the micrograph