File TensorMap.hpp

Parent directory (DlSystem)

Definition (DlSystem/TensorMap.hpp)

Includes

Included By

Full File Listing

namespace DlSystem
class TensorMap
#include <TensorMap.hpp>

Public Functions

TensorMap()

Constructs a TensorMap and returns a handle to it.

Returns

the handle to the created TensorMap

TensorMap(const TensorMap &other)

Copy-Constructs a TensorMap and returns a handle to it.

Parameters

other[in] the other TensorMap to copy

Returns

the handle to the created TensorMap

TensorMap(TensorMap &&other) noexcept
TensorMap &operator=(const TensorMap &other)

Assigns the contents of this handle into other handle.

Parameters

other[in] Destination TensorMap handle

Returns

SNPE_SUCCESS on successful Assignment

TensorMap &operator=(TensorMap &&other) noexcept

Assigns the contents of this handle into other handle.

Parameters

other[in] Destination TensorMap handle

Returns

SNPE_SUCCESS on successful Assignment

DlSystem::ErrorCode add(const char *name, ITensor *tensor)

Adds a name and the corresponding tensor pointer to the map.

Parameters
  • name[in] : The name of the tensor

  • tensor[in] : Handle to access ITensor

Note

If a tensor with the same name already exists, the tensor is replaced with the existing tensor.

void 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

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

Number of tensors in the map

void clear() noexcept

Removes all tensors from the map.

ITensor *getTensor(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 pointer to the tensor.

StringList getTensorNames() const

Retrieve list of all tensor names.

Returns

A StringList of the names of all tensors