Get a mutable tensor data structure. TODO(aselle): Create a safe ArrayHandle interface to avoid exposing this read/write access to structure
| 129 | // TODO(aselle): Create a safe ArrayHandle interface to avoid exposing this |
| 130 | // read/write access to structure |
| 131 | TfLiteTensor* tensor(int tensor_index) { |
| 132 | if (tensor_index < 0 || |
| 133 | static_cast<size_t>(tensor_index) >= context_.tensors_size) { |
| 134 | return nullptr; |
| 135 | } |
| 136 | return &context_.tensors[tensor_index]; |
| 137 | } |
| 138 | |
| 139 | // Get an immutable tensor data structure. |
| 140 | const TfLiteTensor* tensor(int tensor_index) const { |
no outgoing calls