|
nndeploy C++ API
0.2.0
nndeploy C++ API
|
Tensor类 More...
#include <tensor.h>
Public Member Functions | |
| int | addRef () const |
| void | allocate (Device *device, const base::IntVector &config=base::IntVector()) |
| void | allocate (MemoryPool *memory_pool, const base::IntVector &config=base::IntVector()) |
| void | clear () |
| Tensor * | clone () |
| base::Status | copyTo (Tensor *dst) |
| void | create (const std::string &name) |
| void | create (const TensorDesc &desc, Buffer *buffer, const std::string &name="") |
| void | create (const TensorDesc &desc, const std::string &name="") |
| void | create (Device *device, const TensorDesc &desc, const std::string &name="", const base::IntVector &config=base::IntVector()) |
| void | create (Device *device, const TensorDesc &desc, void *data_ptr, const std::string &name="", const base::IntVector &config=base::IntVector()) |
| void | create (MemoryPool *memory_pool, const TensorDesc &desc, const std::string &name="", const base::IntVector &config=base::IntVector()) |
| void | create (MemoryPool *memory_pool, const TensorDesc &desc, void *data_ptr, const std::string &name="", const base::IntVector &config=base::IntVector()) |
| void | deallocate () |
| base::Status | deserialize (const std::string &bin_str) |
| bool | empty () const |
| int | getBatch () const |
| Buffer * | getBuffer () const |
| BufferDesc | getBufferDesc () const |
| int | getChannel () const |
| base::IntVector | getConfig () const |
| void * | getData () const |
| base::DataFormat | getDataFormat () const |
| base::DataType | getDataType () const |
| int | getDepth () const |
| TensorDesc | getDesc () const |
| Device * | getDevice () const |
| base::DeviceType | getDeviceType () const |
| int | getHeight () const |
| MemoryPool * | getMemoryPool () const |
| base::MemoryType | getMemoryType () const |
| std::string | getName () const |
| template<typename T , typename... Args> | |
| T * | getPtr (Args... args) |
| size_t | getRealSize () const |
| base::SizeVector | getRealSizeVector () const |
| base::IntVector | getShape () const |
| int | getShapeIndex (int index) const |
| size_t | getSize () const |
| base::SizeVector | getSizeVector () const |
| base::SizeVector | getStride () const |
| size_t | getStrideIndex (int index) const |
| int | getWidth () const |
| bool | isContinue () const |
| bool | isExternalBuffer () const |
| bool | isMemoryPool () const |
| bool | isSameDesc (Tensor *tensor) const |
| bool | isSameDevice (Tensor *tensor) const |
| bool | isSameMemoryPool (Tensor *tensor) const |
| bool | justModify (Buffer *buffer, bool is_external=true) |
| bool | justModify (const TensorDesc &desc) |
| Tensor & | operator= (const Tensor &tensor) |
| Tensor & | operator= (Tensor &&tensor) noexcept |
| void | print (std::ostream &stream=std::cout) const |
| base::Status | reshape (base::IntVector shape) |
| base::Status | serialize (std::string &bin_str) |
| template<typename T > | |
| base::Status | set (T value) |
| void | setDataFormat (base::DataFormat data_format) |
| void | setDataType (base::DataType data_type) |
| base::Status | setName (const std::string &) |
| int | subRef () const |
| Tensor () | |
| Tensor (const std::string &name) | |
| Tensor (const Tensor &tensor) | |
| Tensor (const TensorDesc &desc, Buffer *buffer, const std::string &name="") | |
| Tensor (const TensorDesc &desc, const std::string &name="") | |
| Tensor (Device *device, const TensorDesc &desc, const std::string &name="", const base::IntVector &config=base::IntVector()) | |
| Tensor (Device *device, const TensorDesc &desc, void *data_ptr, const std::string &name, const base::IntVector &config=base::IntVector()) | |
| Tensor (MemoryPool *memory_pool, const TensorDesc &desc, const std::string &name="", const base::IntVector &config=base::IntVector()) | |
| Tensor (MemoryPool *memory_pool, const TensorDesc &desc, void *data_ptr, const std::string &name, const base::IntVector &config=base::IntVector()) | |
| Tensor (Tensor &&tensor) noexcept | |
| virtual | ~Tensor () |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
| nndeploy::device::Tensor::Tensor | ( | const Tensor & | tensor | ) |
|
noexcept |
|
virtual |
| void nndeploy::device::Tensor::allocate | ( | Device * | device, |
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::allocate | ( | MemoryPool * | memory_pool, |
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::clear | ( | ) |
| Tensor* nndeploy::device::Tensor::clone | ( | ) |
| base::Status nndeploy::device::Tensor::copyTo | ( | Tensor * | dst | ) |
| void nndeploy::device::Tensor::create | ( | const std::string & | name | ) |
| void nndeploy::device::Tensor::create | ( | const TensorDesc & | desc, |
| Buffer * | buffer, | ||
| const std::string & | name = "" |
||
| ) |
| void nndeploy::device::Tensor::create | ( | const TensorDesc & | desc, |
| const std::string & | name = "" |
||
| ) |
| void nndeploy::device::Tensor::create | ( | Device * | device, |
| const TensorDesc & | desc, | ||
| const std::string & | name = "", |
||
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::create | ( | Device * | device, |
| const TensorDesc & | desc, | ||
| void * | data_ptr, | ||
| const std::string & | name = "", |
||
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::create | ( | MemoryPool * | memory_pool, |
| const TensorDesc & | desc, | ||
| const std::string & | name = "", |
||
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::create | ( | MemoryPool * | memory_pool, |
| const TensorDesc & | desc, | ||
| void * | data_ptr, | ||
| const std::string & | name = "", |
||
| const base::IntVector & | config = base::IntVector() |
||
| ) |
| void nndeploy::device::Tensor::deallocate | ( | ) |
| base::Status nndeploy::device::Tensor::deserialize | ( | const std::string & | bin_str | ) |
| bool nndeploy::device::Tensor::empty | ( | ) | const |
| int nndeploy::device::Tensor::getBatch | ( | ) | const |
| Buffer* nndeploy::device::Tensor::getBuffer | ( | ) | const |
| BufferDesc nndeploy::device::Tensor::getBufferDesc | ( | ) | const |
| int nndeploy::device::Tensor::getChannel | ( | ) | const |
| base::IntVector nndeploy::device::Tensor::getConfig | ( | ) | const |
| void* nndeploy::device::Tensor::getData | ( | ) | const |
| base::DataFormat nndeploy::device::Tensor::getDataFormat | ( | ) | const |
| base::DataType nndeploy::device::Tensor::getDataType | ( | ) | const |
| int nndeploy::device::Tensor::getDepth | ( | ) | const |
| TensorDesc nndeploy::device::Tensor::getDesc | ( | ) | const |
| Device* nndeploy::device::Tensor::getDevice | ( | ) | const |
| base::DeviceType nndeploy::device::Tensor::getDeviceType | ( | ) | const |
| int nndeploy::device::Tensor::getHeight | ( | ) | const |
| MemoryPool* nndeploy::device::Tensor::getMemoryPool | ( | ) | const |
| base::MemoryType nndeploy::device::Tensor::getMemoryType | ( | ) | const |
| std::string nndeploy::device::Tensor::getName | ( | ) | const |
|
inline |
| size_t nndeploy::device::Tensor::getRealSize | ( | ) | const |
| base::SizeVector nndeploy::device::Tensor::getRealSizeVector | ( | ) | const |
| base::IntVector nndeploy::device::Tensor::getShape | ( | ) | const |
| int nndeploy::device::Tensor::getShapeIndex | ( | int | index | ) | const |
| size_t nndeploy::device::Tensor::getSize | ( | ) | const |
| base::SizeVector nndeploy::device::Tensor::getSizeVector | ( | ) | const |
| base::SizeVector nndeploy::device::Tensor::getStride | ( | ) | const |
| size_t nndeploy::device::Tensor::getStrideIndex | ( | int | index | ) | const |
| int nndeploy::device::Tensor::getWidth | ( | ) | const |
| bool nndeploy::device::Tensor::isContinue | ( | ) | const |
| bool nndeploy::device::Tensor::isExternalBuffer | ( | ) | const |
| bool nndeploy::device::Tensor::isMemoryPool | ( | ) | const |
| bool nndeploy::device::Tensor::isSameDesc | ( | Tensor * | tensor | ) | const |
| bool nndeploy::device::Tensor::isSameDevice | ( | Tensor * | tensor | ) | const |
| bool nndeploy::device::Tensor::isSameMemoryPool | ( | Tensor * | tensor | ) | const |
| bool nndeploy::device::Tensor::justModify | ( | Buffer * | buffer, |
| bool | is_external = true |
||
| ) |
| bool nndeploy::device::Tensor::justModify | ( | const TensorDesc & | desc | ) |
| void nndeploy::device::Tensor::print | ( | std::ostream & | stream = std::cout | ) | const |
| base::Status nndeploy::device::Tensor::reshape | ( | base::IntVector | shape | ) |
| shape |
# buffer不为空,reshape后的buffer空间小于或当前buffer的空间,reshape并且更新buffer
| base::Status nndeploy::device::Tensor::serialize | ( | std::string & | bin_str | ) |
|
inline |
| void nndeploy::device::Tensor::setDataFormat | ( | base::DataFormat | data_format | ) |
| void nndeploy::device::Tensor::setDataType | ( | base::DataType | data_type | ) |
| base::Status nndeploy::device::Tensor::setName | ( | const std::string & | ) |