From f64475e61d8e385a43fffbe208f3dc10ee09c6d2 Mon Sep 17 00:00:00 2001 From: Liangliang He Date: Thu, 27 Dec 2018 18:16:18 +0800 Subject: [PATCH] Add documents to pass c buffer to MaceTensor --- mace/public/mace.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mace/public/mace.h b/mace/public/mace.h index 90b1c16f..a7b2a13e 100644 --- a/mace/public/mace.h +++ b/mace/public/mace.h @@ -262,7 +262,12 @@ class MACE_API MaceTensor { public: // shape - the shape of the tensor, with size n // data - the buffer of the tensor, must not be null with size equals - // shape[0] * shape[1] * ... * shape[n-1] + // shape[0] * shape[1] * ... * shape[n-1]. + // If you want to pass a buffer which is unsuitable to use the default + // shared_ptr deleter (for example, the buffer is not dynamically + // allocated by C++, e.g. a C buffer), you can set customized deleter + // of shared_ptr and manage the life cycle of the buffer by yourself. + // For example, std::shared_ptr(raw_buffer, [](float *){}); MaceTensor(const std::vector &shape, std::shared_ptr data, const DataFormat format = DataFormat::NHWC); -- GitLab