experimental_experiment.xbuilder.shape_type_compute¶
- experimental_experiment.xbuilder.shape_type_compute.broadcast_shape(sh1: Tuple[int, ...], sh2: Tuple[int, ...], graph_builder: GraphBuilder | None = None) Tuple[int, ...] [source]¶
Computes the shape for many broadcasting operators.
- Parameters:
sh1 – first shape
sh2 – second shape
graph_builder – if not None, the function register any constraint which might appear while applying the broadcast
- Returns:
resulting shape
- experimental_experiment.xbuilder.shape_type_compute.prepare_inputs_homogeneous_operator(g: GraphBuilder, *args: Sequence[str], f: Callable | None = None, outputs: List[str] | None = None, name: str | None = None, sts: Any | None = None, check_shape: bool = True) Tuple[str, ...] [source]¶
Cast any inputs to ensure all inputs share the same type.
- experimental_experiment.xbuilder.shape_type_compute.set_shape_type_custom(self: GraphBuilder, node: NodeProto)[source]¶
Sets the shape and type if it can.
- experimental_experiment.xbuilder.shape_type_compute.set_shape_type_op_any(self: GraphBuilder, node: NodeProto)[source]¶
Sets the shape and type if it can.