Skip to content
Snippets Groups Projects
Commit 7bc22c78 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Fix issue with Identity nb output.

parent d01920a4
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
static const std::string Type; static const std::string Type;
Identity_Op() Identity_Op()
: OperatorTensor(Type, 1, 0, 0) : OperatorTensor(Type, 1, 0, 1)
{ {
mImpl = std::make_shared<OperatorImpl>(*this); mImpl = std::make_shared<OperatorImpl>(*this);
} }
...@@ -101,7 +101,10 @@ public: ...@@ -101,7 +101,10 @@ public:
if (outputIdx >= nbInputs()) { if (outputIdx >= nbInputs()) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "%s Operator has %hu outputs", type().c_str(), nbInputs()); AIDGE_THROW_OR_ABORT(std::runtime_error, "%s Operator has %hu outputs", type().c_str(), nbInputs());
} }
return mInputs[outputIdx]; if (mInputs[outputIdx] == nullptr){
return mOutputs[outputIdx]; // Input is not initialized with empty tensor
}
return mInputs[outputIdx]; // Identity, so Output is Input
} }
void setBackend(const std::string& /*name*/, DeviceIdx_t /*device*/ = 0) override final { void setBackend(const std::string& /*name*/, DeviceIdx_t /*device*/ = 0) override final {
// setBackend do nothing, Identity node has no backend it just pass the same Tensor // setBackend do nothing, Identity node has no backend it just pass the same Tensor
......
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