yobx.tensorflow.ops.xla_call_module_layer#

Layer class for the XlaCallModule converter.

XlaLayer represents a single StableHLO operation parsed from a StableHLO MLIR module. It replaces the plain dict that was previously used so that layer fields are typed, documented, and accessible via attribute syntax as well as the legacy layer["key"] dict-style syntax.

class yobx.tensorflow.ops.xla_call_module_layer.XlaLayer(id: str, op: str, operands: List[str] | Sequence[str], shape: str = '', loc: str = '', *, dense_content: str = '', dims: List[int] | None = None, axes: List[int] | None = None, func: str = '', lhs_contracting: List[int] | None = None, rhs_contracting: List[int] | None = None)[source]#

Represents a single StableHLO operation layer.

All layers carry the four core fields id, op, operands, shape, and loc. Op-specific optional fields default to empty / None and are populated only for the ops that require them.

Dict-style access (layer["op"], layer.get("axes", [])) is supported for backward compatibility with code that was written against the plain-dict API.

Parameters:
  • id – SSA result identifier (e.g. "%0").

  • op – Operation name (e.g. "sine", "Input", "return").

  • operands – List (or tuple) of input SSA ids.

  • shape – Result tensor type string (e.g. "tensor<3x4xf32>").

  • loc – Source location from loc(...) annotations.

  • dense_content – Raw dense value string for constant ops.

  • dims – Broadcast dimension list for broadcast_in_dim / dynamic_broadcast_in_dim ops.

  • axes – Reduction axis list for reduce_max / reduce_sum ops.

  • func – Callee name for call ops.

  • lhs_contracting – LHS contracting dimensions for dot_general.

  • rhs_contracting – RHS contracting dimensions for dot_general.

get(key: str, default=None)[source]#

Returns the attribute named key, or default when not present.