From f645194b4a366307e66b8207e616b5b369ed098e Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 3 Jun 2021 13:17:57 -0500 Subject: [PATCH 1/2] Graph executor: remove unnecessary unique_ptr, NFC --- src/runtime/graph_executor/graph_executor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/graph_executor/graph_executor.cc b/src/runtime/graph_executor/graph_executor.cc index ad5b99e06c7e..a0eb23e29b86 100644 --- a/src/runtime/graph_executor/graph_executor.cc +++ b/src/runtime/graph_executor/graph_executor.cc @@ -267,10 +267,10 @@ void GraphExecutor::DefaultLookupLinkedParam(TVMArgs args, TVMRetValue* rv) { std::vector shape_vec{template_tensor->shape, template_tensor->shape + template_tensor->ndim}; - std::unique_ptr container{new NDArray::Container( - static_cast(opaque_handle), shape_vec, template_tensor->dtype, dev)}; + auto* container = new NDArray::Container( + static_cast(opaque_handle), shape_vec, template_tensor->dtype, dev); container->SetDeleter(GraphExecutor::LinkedNDArrayDeleter); - *rv = NDArray(GetObjectPtr(container.release())); + *rv = NDArray(GetObjectPtr(container)); } void GraphExecutor::SetupStorage() { From d051edd57764104cb99d2b73bc93b8c697d1ce18 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Tue, 8 Jun 2021 12:14:10 -0500 Subject: [PATCH 2/2] Apply clang-format --- src/runtime/graph_executor/graph_executor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/graph_executor/graph_executor.cc b/src/runtime/graph_executor/graph_executor.cc index a0eb23e29b86..1084b4ee3ec4 100644 --- a/src/runtime/graph_executor/graph_executor.cc +++ b/src/runtime/graph_executor/graph_executor.cc @@ -267,8 +267,8 @@ void GraphExecutor::DefaultLookupLinkedParam(TVMArgs args, TVMRetValue* rv) { std::vector shape_vec{template_tensor->shape, template_tensor->shape + template_tensor->ndim}; - auto* container = new NDArray::Container( - static_cast(opaque_handle), shape_vec, template_tensor->dtype, dev); + auto* container = new NDArray::Container(static_cast(opaque_handle), shape_vec, + template_tensor->dtype, dev); container->SetDeleter(GraphExecutor::LinkedNDArrayDeleter); *rv = NDArray(GetObjectPtr(container)); }