Returns the first aligned offset after a given tensor.
| 191 | |
| 192 | // Returns the first aligned offset after a given tensor. |
| 193 | int64_t GetOffsetAfter(int tensor_index) { |
| 194 | const TfLiteTensor& tensor = (*graph_->tensors())[tensor_index]; |
| 195 | int64_t offset = GetOffset(tensor_index) + tensor.bytes; |
| 196 | // We must make sure the offset is aligned to kDefaultArenaAlignment. |
| 197 | if (offset % kTensorAlignment != 0) { |
| 198 | offset += kTensorAlignment - offset % kTensorAlignment; |
| 199 | } |
| 200 | return offset; |
| 201 | }; |
| 202 | |
| 203 | TfLiteContext context_; |
| 204 | TestGraph* graph_; |