Skip to main content

Module ext_op

Module ext_op 

Source
Expand description

Out-of-tree extension-operation mechanism.

This module implements the ExtensionOp trait and its process-local registry. Together they let external crates contribute fused primitives that participate in the crate::std_tensor_op::StdTensorOp graph through the single carrier variant StdTensorOp::Extension(Arc<dyn ExtensionOp>).

See docs/spec/extension-op.md for the normative contract. Key points:

  • Identity / hashing / equality are expressed on the trait so the type-erased Arc<dyn ExtensionOp> carrier can satisfy Clone + Hash + Eq + Send + Sync + 'static (computegraph’s GraphOperation requirements).
  • AD rules are owned by explicit ExtensionRuleSet values. A rule may emit core StdTensorOp values and registered Extension values so out-of-tree operations remain in the same graph.
  • Extension ops themselves do not require process-global registration. Frontends carry them directly as Arc<dyn ExtensionOp>.

Structs§

ExtensionLoweringError
Error returned when an extension cannot expand itself into standard ops.
ExtensionRuleSet
Explicit, owned set of extension AD rules.

Enums§

ExtensionRegistryError
Errors returned from extension registries.

Traits§

ExtensionAdRule
AD rule provider for an extension family.
ExtensionOp
The contract every out-of-tree extension primitive must satisfy.

Functions§

linearize_extension_rule
Emit a registered extension linearization rule.
transpose_extension_rule
Emit a registered extension transpose rule.

Type Aliases§

ExtensionLoweringResult
Result returned by ExtensionOp::lower_to_standard_ops.