Public Member Functions | |
def | __init__ (self, model, name=None) |
def | activate_impl (self) |
def | deactivate_impl (self) |
def | infer_impl (self, feed_dict) |
def | get_input_metadata (self) |
def | last_inference_time (self) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_value, traceback) |
def | activate (self) |
def | infer_impl (self) |
def | infer (self, feed_dict) |
def | deactivate (self) |
Public Attributes | |
tf_rep | |
inference_time | |
name | |
is_active | |
Static Public Attributes | |
RUNNER_COUNTS = defaultdict(int) | |
Private Attributes | |
_model | |
Runs an ONNX model using the TensorFlow backend for ONNX.
def polygraphy.backend.onnx.runner.OnnxTfRunner.__init__ | ( | self, | |
model, | |||
name = None |
|||
) |
Creates an ONNX-TF runner.
Reimplemented from polygraphy.backend.base.runner.BaseRunner.
def polygraphy.backend.onnx.runner.OnnxTfRunner.activate_impl | ( | self | ) |
Implementation for runner activation. Derived classes should override this function rather than ``activate()``.
Reimplemented from polygraphy.backend.base.runner.BaseRunner.
def polygraphy.backend.onnx.runner.OnnxTfRunner.deactivate_impl | ( | self | ) |
Implementation for runner deactivation. Derived classes should override this function rather than ``deactivate()``.
Reimplemented from polygraphy.backend.base.runner.BaseRunner.
def polygraphy.backend.onnx.runner.OnnxTfRunner.infer_impl | ( | self, | |
feed_dict | |||
) |
def polygraphy.backend.onnx.runner.OnnxTfRunner.get_input_metadata | ( | self | ) |
Returns information about the inputs of the model. Shapes here may include dynamic dimensions, represented by ``None``. Must be called only after activate() and before deactivate(). Returns: TensorMetadata: Input names, shapes, and data types.
Reimplemented from polygraphy.backend.base.runner.BaseRunner.
|
inherited |
Returns the total inference time required during the last call to ``infer()``. Returns: float: The time in seconds, or None if runtime was not measured by the runner.
|
inherited |
|
inherited |
|
inherited |
Activate the runner for inference. This may involve allocating GPU buffers, for example.
|
inherited |
Implementation for runner inference. Derived classes should override this function rather than ``infer()``
|
inherited |
Runs inference using the provided feed_dict. Args: feed_dict (OrderedDict[str, numpy.ndarray]): A mapping of input tensor names to corresponding input NumPy arrays. Returns: OrderedDict[str, numpy.ndarray]: A mapping of output tensor names to their corresponding NumPy arrays. IMPORTANT: Runners may reuse these output buffers. Thus, if you need to save outputs from multiple inferences, you should make a copy with ``copy.copy(outputs)``.
|
inherited |
Deactivate the runner.
|
private |
polygraphy.backend.onnx.runner.OnnxTfRunner.tf_rep |
polygraphy.backend.onnx.runner.OnnxTfRunner.inference_time |
|
staticinherited |
|
inherited |
|
inherited |