Added tests to validate opcreatetensor components

This commit is contained in:
Alejandro Saucedo 2020-08-31 12:59:22 +01:00
parent 782c9f4fe8
commit 8adb7ab49d
4 changed files with 283 additions and 1 deletions

View file

@ -85,7 +85,7 @@ Tensor::tensorType()
bool
Tensor::isInit()
{
return this->mIsInit;
return this->mIsInit && this->mBuffer && this->mMemory;
}
void
@ -352,6 +352,7 @@ Tensor::freeMemoryDestroyGPUResources()
} else {
SPDLOG_DEBUG("Kompose Tensor destroying buffer");
this->mDevice->destroy(*this->mBuffer);
this->mBuffer = nullptr;
}
}
@ -362,6 +363,7 @@ Tensor::freeMemoryDestroyGPUResources()
} else {
SPDLOG_DEBUG("Kompose Tensor freeing memory");
this->mDevice->freeMemory(*this->mMemory);
this->mDevice = nullptr;
}
}