| 73 | } |
| 74 | |
| 75 | bool Tensor::call_accessor() |
| 76 | { |
| 77 | // Early exit guard |
| 78 | if (!_accessor || !_handle) |
| 79 | { |
| 80 | return false; |
| 81 | } |
| 82 | |
| 83 | const bool access_data = _accessor->access_tensor_data(); |
| 84 | |
| 85 | if (access_data) |
| 86 | { |
| 87 | // Map tensor |
| 88 | _handle->map(true); |
| 89 | |
| 90 | // Return in case of null backend buffer |
| 91 | if (_handle->tensor().buffer() == nullptr) |
| 92 | { |
| 93 | return false; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // Call accessor |
| 98 | bool retval = _accessor->access_tensor(_handle->tensor()); |
| 99 | |
| 100 | if (access_data) |
| 101 | { |
| 102 | // Unmap tensor |
| 103 | _handle->unmap(); |
| 104 | } |
| 105 | |
| 106 | return retval; |
| 107 | } |
| 108 | |
| 109 | void Tensor::bind_edge(EdgeID eid) |
| 110 | { |
no test coverage detected