Skip to content
Snippets Groups Projects
Commit c2410067 authored by Noam Zerah's avatar Noam Zerah Committed by Olivier BICHLER
Browse files

Fixing the resetInput method to work with MetaOperators

parent 2afc296e
No related branches found
No related tags found
2 merge requests!408[Add] Dropout Operator,!374Fixing the resetInput method to work with MetaOperators
Pipeline #68756 passed
......@@ -122,7 +122,13 @@ public:
* @param data Shared pointer to the data tensor.
*/
void setInput(const IOIndex_t inputIdx, const std::shared_ptr<Data>& data) override final;
/**
* @brief Resets the input tensor at a given index.
* @param[in] inputIdx Index of the input to reset.
*/
void resetInput(const IOIndex_t inputIdx) override;
/**
* @brief Forward the dimensions through the micro-graph.
*
......
......@@ -94,7 +94,7 @@ public:
* @brief Resets the input tensor at a given index.
* @param[in] inputIdx Index of the input to reset.
*/
void resetInput(const IOIndex_t inputIdx) override final;
virtual void resetInput(const IOIndex_t inputIdx) override;
///////////////////////////////////////////////////
///////////////////////////////////////////////////
......
......@@ -106,6 +106,14 @@ void Aidge::MetaOperator_Op::setInput(const Aidge::IOIndex_t inputIdx, const std
mInputs[inputIdx] = std::dynamic_pointer_cast<Tensor>(inputOp.first->getOperator()->getRawInput(inputOp.second));
}
void Aidge::MetaOperator_Op::resetInput(const Aidge::IOIndex_t inputIdx) {
const auto& inputOp = mGraph->getOrderedInputs()[inputIdx];
AIDGE_ASSERT(inputIdx < inputOp.first->nbInputs(), "Input idx out of range.");
inputOp.first->getOperator()->resetInput(inputIdx);
mInputs[inputIdx] = std::dynamic_pointer_cast<Tensor>(inputOp.first->getOperator()->getRawInput(inputOp.second));
}
std::string Aidge::MetaOperator_Op::backend() const noexcept {
return (mImpl)
? mImpl->backend()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment