diff --git a/mace/public/mace.h b/mace/public/mace.h index 90b1c16fe6260ce46d67e049e609534d33ef45de..a7b2a13edb7b9d043bb7495bd3ccc327453a1448 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);