yobx.xshape.type_inference

yobx.xshape.type_inference.infer_types(node: FunctionProto | NodeProto, input_types: Sequence[int], output_name: str | None = None, exc: bool = True) int | Sequence[int][source][source]

Tries to infer the type of an output or all outputs.

Parameters:
  • node – NodeProto

  • input_types – type of the elements of the input tensors

  • output_name – type for the desired output or all types if all are needed

  • exc – raise an exception if type cannot be inferred

Returns:

tuple of types or output type