Invoke the interpreter. Be sure to set the input sizes, allocate tensors and fill values before calling this. Also, note that this function releases the GIL so heavy computation can be done in the background while the Python interpreter continues. No other function on this object sh
(self)
| 438 | return lambda: self._interpreter.tensor(self._interpreter, tensor_index) |
| 439 | |
| 440 | def invoke(self): |
| 441 | """Invoke the interpreter. |
| 442 | |
| 443 | Be sure to set the input sizes, allocate tensors and fill values before |
| 444 | calling this. Also, note that this function releases the GIL so heavy |
| 445 | computation can be done in the background while the Python interpreter |
| 446 | continues. No other function on this object should be called while the |
| 447 | invoke() call has not finished. |
| 448 | |
| 449 | Raises: |
| 450 | ValueError: When the underlying interpreter fails raise ValueError. |
| 451 | """ |
| 452 | self._ensure_safe() |
| 453 | self._interpreter.Invoke() |
| 454 | |
| 455 | def reset_all_variables(self): |
| 456 | return self._interpreter.ResetVariableTensors() |