#include <TensorSet.h>
|
| TensorSet (Allocator *allocator, size_t nums) |
|
| ~TensorSet (void) |
|
void | set (size_t index, const std::string &name, ONNXTensorElementDataType type, const std::vector< size_t > &dims) |
|
size_t | size (void) |
|
const char * | name (size_t index) |
|
const std::vector< std::string > & | names (void) |
|
ONNXTensorElementDataType | type (size_t index) |
|
const std::vector< size_t > & | dim (size_t index) |
|
const OrtValue * | tensor (size_t index) |
|
const std::vector< OrtValue * > & | tensors (void) |
|
OrtValue * | mutable_tensor (size_t index) |
|
std::vector< OrtValue * > | mutable_tensors (void) |
|
Definition at line 36 of file TensorSet.h.
◆ TensorSet()
nnkit::support::onnx::TensorSet::TensorSet |
( |
Allocator * |
allocator, |
|
|
size_t |
nums |
|
) |
| |
|
inline |
Definition at line 39 of file TensorSet.h.
40 : _allocator(allocator), _names(nums), _types(nums), _dims(nums), _tensors(nums, nullptr)
41 {
42
43 }
◆ ~TensorSet()
nnkit::support::onnx::TensorSet::~TensorSet |
( |
void |
| ) |
|
|
inline |
Definition at line 45 of file TensorSet.h.
46 {
47 for (auto it : _tensors)
48 {
49 OrtReleaseValue(it);
50 }
51 }
◆ dim()
const std::vector< size_t > & nnkit::support::onnx::TensorSet::dim |
( |
size_t |
index | ) |
|
|
inline |
◆ mutable_tensor()
OrtValue * nnkit::support::onnx::TensorSet::mutable_tensor |
( |
size_t |
index | ) |
|
|
inline |
◆ mutable_tensors()
std::vector< OrtValue * > nnkit::support::onnx::TensorSet::mutable_tensors |
( |
void |
| ) |
|
|
inline |
◆ name()
const char * nnkit::support::onnx::TensorSet::name |
( |
size_t |
index | ) |
|
|
inline |
◆ names()
const std::vector< std::string > & nnkit::support::onnx::TensorSet::names |
( |
void |
| ) |
|
|
inline |
◆ set()
void nnkit::support::onnx::TensorSet::set |
( |
size_t |
index, |
|
|
const std::string & |
name, |
|
|
ONNXTensorElementDataType |
type, |
|
|
const std::vector< size_t > & |
dims |
|
) |
| |
|
inline |
Definition at line 53 of file TensorSet.h.
55 {
59
60 Status status;
61
62 status =
63 OrtCreateTensorAsOrtValue(_allocator, dims.data(), dims.size(),
type, &_tensors[index]);
64 status.throwOnError();
65
66 assert(OrtIsTensor(_tensors[index]));
67 }
const char * name(size_t index)
ONNXTensorElementDataType type(size_t index)
References name(), nnkit::support::onnx::Status::throwOnError(), and type().
◆ size()
size_t nnkit::support::onnx::TensorSet::size |
( |
void |
| ) |
|
|
inline |
◆ tensor()
const OrtValue * nnkit::support::onnx::TensorSet::tensor |
( |
size_t |
index | ) |
|
|
inline |
◆ tensors()
const std::vector< OrtValue * > & nnkit::support::onnx::TensorSet::tensors |
( |
void |
| ) |
|
|
inline |
◆ type()
ONNXTensorElementDataType nnkit::support::onnx::TensorSet::type |
( |
size_t |
index | ) |
|
|
inline |
The documentation for this class was generated from the following file:
- compiler/nnkit-onnxrt/support/include/nnkit/support/onnx/TensorSet.h