yobx.xshape._inference_runtime#
- class yobx.xshape._inference_runtime._InferenceRuntime[source]#
Sets shape and type.
- class ShapeConstant(name: str, shape: Tuple[int, ...], node: NodeProto)[source]#
Wraps a constant shape even if the input producing the shape is not.
- compute_constant(name: str, exc: bool = True, only_array: bool = False, allow_empty: bool = False) Tuple[ndarray | None, 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.