1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Shape Inference Registry for TenfloweRS
//!
//! This module provides a centralized registry for shape inference rules across
//! all tensor operations, ensuring consistent shape validation and error reporting.
//!
//! ## Design Goals
//! - **Centralization**: Single source of truth for shape inference logic
//! - **Standardization**: Consistent error messages using ShapeErrorTaxonomy
//! - **Discoverability**: Easy to find shape inference rules for any operation
//! - **Type Safety**: Compile-time guarantees where possible
//!
//! ## Usage
//!
//! ```rust,ignore
//! use tenflowers_core::ops::shape_inference_registry::{ShapeInferenceRegistry, get_registry};
//!
//! // Get the global registry
//! let registry = get_registry();
//!
//! // Infer output shape for an operation
//! let output_shape = registry.infer("add", &[input1.shape(), input2.shape()], &metadata)?;
//!
//! // Validate inputs for an operation
//! registry.validate("matmul", &[a.shape(), b.shape()], &metadata)?;
//! ```
//!
//! Submodules:
//! - `types`: `OperationMetadata`, `MetadataValue`, `OperationCategory`, `ShapeInferenceFn`
//! - `registry`: `ShapeInferenceRegistry` struct + built-in registration
//! - `infer_fns`: all shape inference function implementations
//! - `global`: global singleton registry access (`get_registry`, `initialize_registry`)
pub use ;
pub use ShapeInferenceRegistry;
pub use ;