31 : _id(id), _desc(
std::move(desc)), _handle(nullptr), _accessor(nullptr), _bound_edges()
52 _handle = std::move(backend_tensor);
62 _accessor = std::move(accessor);
67 return _accessor.get();
72 return std::move(_accessor);
78 if(!_accessor || !_handle)
87 if(_handle->tensor().buffer() ==
nullptr)
93 bool retval = _accessor->access_tensor(_handle->tensor());
103 _bound_edges.insert(eid);
108 _bound_edges.erase(eid);
bool call_accessor()
Calls accessor on tensor.
void set_handle(std::unique_ptr< ITensorHandle > backend_tensor)
Sets the backend tensor.
ITensorHandle * handle()
Backend tensor handle accessor.
Tensor(TensorID id, TensorDescriptor desc)
Default constructor.
void set_accessor(std::unique_ptr< ITensorAccessor > accessor)
Sets the backend tensor accessor.
Copyright (c) 2017-2021 Arm Limited.
TensorDescriptor & desc()
TensorInfo metadata accessor.
void bind_edge(EdgeID eid)
Binds the tensor with an edge.
ITensorAccessor * accessor()
Backend tensor accessor.
void unbind_edge(EdgeID eid)
Unbinds an edge from a tensor.
Tensor handle interface object.
Tensor accessor interface.
TensorID id() const
Tensor ID accessor.
std::set< EdgeID > bound_edges() const
Accessor the edges that are bound with the tensor.
std::unique_ptr< ITensorAccessor > extract_accessor()
Extracts accessor from the tensor.