Class TensorShapeMap¶
Defined in File TensorShapeMap.hpp
Class Documentation¶
-
class TensorShapeMap¶
Public Functions
-
TensorShapeMap()¶
Constructs a TensorShapeMap and returns a handle to it.
- Returns
the handle to the created TensorShapeMap
-
TensorShapeMap(const TensorShapeMap &other)¶
Copy constructor.
- Parameters
other – [in] : Handle to the other object to copy.
- Returns
the handle to the created TensorShapeMap
-
TensorShapeMap(TensorShapeMap &&other) noexcept¶
-
TensorShapeMap &operator=(const TensorShapeMap &other)¶
Assignment operator. Assigns from handle to other handle.
- Parameters
other – [out] : handle to destination Tensor Shape Map object
- Returns
Returns SNPE_SUCCESS if Assignment successful
-
TensorShapeMap &operator=(TensorShapeMap &&other) noexcept¶
Assignment operator. Assigns from handle to other handle.
- Parameters
other – [out] : handle to destination Tensor Shape Map object
- Returns
Returns SNPE_SUCCESS if Assignment successful
-
DlSystem::ErrorCode add(const char *name, const TensorShape &tensorShape)¶
Adds a name and the corresponding tensor pointer to the map.
- Parameters
name – [in] The name of the tensor
tensorShape – [in] : Tensor Shape
- Returns
Returns SNPE_SUCCESS if Add operation successful
Note
If a tensor with the same name already exists, no new tensor is added.
-
DlSystem::ErrorCode remove(const char *name) noexcept¶
Removes a mapping of tensor and its name by its name.
- Parameters
name – [in] The name of tensor to be removed
- Returns
Returns SNPE_SUCCESS if Remove operation successful
Note
If no tensor with the specified name is found, nothing is done.
-
size_t size() const noexcept¶
Returns the number of tensors in the map.
- Returns
Returns number entries in TensorShapeMap
-
DlSystem::ErrorCode clear() noexcept¶
Removes all tensors from the map.
- Returns
Returns SNPE_SUCCESS if Clear operation successful
-
TensorShape getTensorShape(const char *name) const noexcept¶
Returns the tensor given its name.
- Parameters
name – [in] The name of the tensor to get.
- Returns
nullptr if no tensor with the specified name is found; otherwise, a valid Tensor Shape Handle.
-
StringList getTensorShapeNames() const¶
Retrieves tensor names.
- Returns
A stringList Handle to access names of all tensor shapes
-
TensorShapeMap()¶