.xshape._inference_runtime

class experimental_experiment.xshape._inference_runtime._InferenceRuntime[source]

Sets shape and type.

_make_node_set_type_shape(node: NodeProto, exc: bool = False)[source]

Updates shapes for a node.

compute_constant(name: str, exc: bool = True, only_array: bool = False, allow_empty: bool = False) Tuple[ndarray, Dict[str, ndarray] | None][source]

Computes a constant.

Parameters:
  • name – constant name

  • exc – raises an exception if any failure

  • only_array – do not return TensorProto

  • allow_empty – allow empty result

Returns:

constant

If returns None if the constant is a FakeTensor.

make_dimension_name_if_necessary(a: int | str, b: int | str, op: str) str[source]

Creates a new dimension.

update_node_constant(name: str, node: NodeProto) bool[source]

Updates a constant NodeProto.