Added invalidate handle marco

Type: Code Improvement
Signed-off-by: Feiyue Chen <Feiyue.Chen@verisilicon.com>
This commit is contained in:
Feiyue Chen 2022-12-01 09:37:40 +08:00 committed by Sven
parent f7b49ae4e2
commit b7478f7872
1 changed files with 3 additions and 0 deletions

View File

@ -172,6 +172,9 @@ bool TensorImpl::CopyDataFromTensor(void* data) {
if (tensor->attr.is_created_from_handle) {
void* ptr = NULL;
vsi_nn_GetTensorHandle(tensor, &ptr);
#ifdef VSI_INVALIDATE_HANDLE_SUPPORT
vsi_nn_InvalidateHandle(tensor);
#endif
if (ptr) {
memcpy(data, ptr, tensor_bytes);
retn = true;