diff --git a/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp b/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp index 80c039515..0337fa63e 100755 --- a/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp +++ b/examples/android/android-simple/app/src/main/cpp/KomputeModelML.cpp @@ -42,14 +42,7 @@ void KomputeModelML::train(std::vector yData, std::vector xIData, kp::Manager mgr; { - - std::shared_ptr sqTensor = - mgr.sequence(); - - sqTensor->begin(); - sqTensor->record(params); - sqTensor->end(); - sqTensor->eval(); + mgr.rebuild(params); std::shared_ptr sq = mgr.sequence(); diff --git a/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp b/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp index 05c800b2c..304416a0f 100644 --- a/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp +++ b/examples/godot_examples/custom_module/kompute_summator/KomputeSummatorNode.cpp @@ -12,7 +12,7 @@ void KomputeSummatorNode::add(float value) { // Set the new data in the local device this->mSecondaryTensor->setData({value}); // Execute recorded sequence - if (std::shared_ptr sq = this->mSequence.lock()) { + if (std::shared_ptr sq = this->mSequence) { sq->eval(); } else { @@ -34,7 +34,7 @@ void KomputeSummatorNode::_init() { this->mSequence = this->mManager.sequence("AdditionSeq"); // We now record the steps in the sequence - if (std::shared_ptr sq = this->mSequence.lock()) + if (std::shared_ptr sq = this->mSequence) { std::string shader(R"( @@ -59,7 +59,7 @@ void KomputeSummatorNode::_init() { { this->mSecondaryTensor }); // Then we run the operation with both tensors - sq->record>( + sq->record( { this->mPrimaryTensor, this->mSecondaryTensor }, std::vector(shader.begin(), shader.end())); diff --git a/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp b/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp index 38dd6772e..010a3164d 100644 --- a/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp +++ b/examples/godot_logistic_regression/custom_module/kompute_model_ml/KomputeModelMLNode.cpp @@ -50,14 +50,9 @@ void KomputeModelMLNode::train(Array yArr, Array xIArr, Array xJArr) { { kp::Manager mgr; - std::shared_ptr sqTensor = - mgr.sequence(); - - sqTensor->begin(); - sqTensor->record(params); - sqTensor->end(); - sqTensor->eval(); + mgr.rebuild(params); + { std::shared_ptr sq = mgr.sequence(); // Record op algo base diff --git a/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp b/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp index f868f5069..e9a9c51b5 100644 --- a/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp +++ b/examples/godot_logistic_regression/gdnative_shared/src/KomputeModelML.cpp @@ -55,13 +55,7 @@ void KomputeModelML::train(Array yArr, Array xIArr, Array xJArr) { kp::Manager mgr; { - std::shared_ptr sqTensor = - mgr.sequence(); - - sqTensor->begin(); - sqTensor->record(params); - sqTensor->end(); - sqTensor->eval(); + mgr.rebuild(params); std::shared_ptr sq = mgr.sequence(); diff --git a/examples/logistic_regression/src/Main.cpp b/examples/logistic_regression/src/Main.cpp index 1efbe83ba..14664a563 100755 --- a/examples/logistic_regression/src/Main.cpp +++ b/examples/logistic_regression/src/Main.cpp @@ -35,13 +35,7 @@ int main() kp::Manager mgr; - std::shared_ptr sqTensor = - mgr.sequence(); - - sqTensor->begin(); - sqTensor->record(params); - sqTensor->end(); - sqTensor->eval(); + mgr.rebuild(params); std::shared_ptr sq = mgr.sequence();