onnx_diagnostic.torch_onnx.runtime_info¶
- class onnx_diagnostic.torch_onnx.runtime_info.RuntimeDevice(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source][source]¶
Device definition
- class onnx_diagnostic.torch_onnx.runtime_info.RuntimeValue(name: str, dtype: Any | None = None, shape: Tuple[int | str, ...] | None = None, value: Any | None = None, first_used: int | None = None, last_used: int | None = None, created: int | None = None, is_shape: bool | None = None, kind: RuntimeValueKind | None = None, device: RuntimeDevice | None = None)[source][source]¶
Describes a value used during the execution of a model.
- set_value(value: Tensor | TensorLike)[source][source]¶
Sets the value.
- class onnx_diagnostic.torch_onnx.runtime_info.RuntimeValueKind(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source][source]¶
Kind of result.
- onnx_diagnostic.torch_onnx.runtime_info.first_used_last_used(proto: FunctionProto | GraphProto | ModelProto, constant_as_initializer: bool = False) Dict[str, RuntimeValue] [source][source]¶
Builds first used, last used information for every result in the model.
- Parameters:
proto – model, graph or function
constant_as_initializer – outputs of node Constant is tagged as INITIALIZER
- Returns:
dictionary of RuntimeValue
Returns the hidden inputs (inputs coming from an upper context) used by a subgraph.
- onnx_diagnostic.torch_onnx.runtime_info.set_is_shape(node: NodeProto, values: Dict[str, RuntimeValue], drop: Set[str] | None = None) List[str] [source][source]¶
Sets attribute
is_shape
for outputs of a node.- Parameters:
node – node to process
values – stored results, values in this dictionary are updated
drop – variables not to consider because the come from the graph holding this subgraph
- Returns:
list of modified results