Sets the value of the input tensor. Note this copies data in `value`. If you want to avoid copying, you can use the `tensor()` function to get a numpy buffer pointing to the input buffer in the tflite interpreter. Args: tensor_index: Tensor index of tensor to set. This value can
(self, tensor_index, value)
| 330 | ] |
| 331 | |
| 332 | def set_tensor(self, tensor_index, value): |
| 333 | """Sets the value of the input tensor. Note this copies data in `value`. |
| 334 | |
| 335 | If you want to avoid copying, you can use the `tensor()` function to get a |
| 336 | numpy buffer pointing to the input buffer in the tflite interpreter. |
| 337 | |
| 338 | Args: |
| 339 | tensor_index: Tensor index of tensor to set. This value can be gotten from |
| 340 | the 'index' field in get_input_details. |
| 341 | value: Value of tensor to set. |
| 342 | |
| 343 | Raises: |
| 344 | ValueError: If the interpreter could not set the tensor. |
| 345 | """ |
| 346 | self._interpreter.SetTensor(tensor_index, value) |
| 347 | |
| 348 | def resize_tensor_input(self, input_index, tensor_size): |
| 349 | """Resizes an input tensor. |