Gets the value of the input tensor (get a copy). If you wish to avoid the copy, use `tensor()`. This function cannot be used to read intermediate results. Args: tensor_index: Tensor index of tensor to get. This value can be gotten from the 'index' field in get
(self, tensor_index)
| 373 | ] |
| 374 | |
| 375 | def get_tensor(self, tensor_index): |
| 376 | """Gets the value of the input tensor (get a copy). |
| 377 | |
| 378 | If you wish to avoid the copy, use `tensor()`. This function cannot be used |
| 379 | to read intermediate results. |
| 380 | |
| 381 | Args: |
| 382 | tensor_index: Tensor index of tensor to get. This value can be gotten from |
| 383 | the 'index' field in get_output_details. |
| 384 | |
| 385 | Returns: |
| 386 | a numpy array. |
| 387 | """ |
| 388 | return self._interpreter.GetTensor(tensor_index) |
| 389 | |
| 390 | def tensor(self, tensor_index): |
| 391 | """Returns function that gives a numpy view of the current tensor buffer. |