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
//! The **size oracle**: byte size of an activation value.
//!
//! Sizes may be unknown at build time when a shape has symbolic (dynamic)
//! dimensions. The planner is generic over any `Fn(ValueId) -> Option<usize>`
//! so the *same* algorithm serves two callers:
//!
//! * **build-time** planning from fully-static shapes ([`static_size_oracle`]),
//! which returns `None` for any symbolic-shaped value and drives the planner
//! to a [`crate::PlanStatus::Deferred`] result; and
//! * **run-time** planning, where the executor supplies a closure backed by the
//! resolved concrete shapes for the current run.
use ;
/// Byte size of a value from its *static* shape, or `None` if any dimension is
/// symbolic (unknown until run time) or the element count overflows `usize`.
///
/// Uses [`onnx_runtime_ir::DataType::checked_storage_bytes`] so sub-byte packed
/// types (`int4`/`uint4`/`float4`) are sized correctly and an overflowing
/// element count becomes `None` rather than a wrapped under-count.
/// A size oracle closure that sizes values from their fully-static shapes.
///
/// Returns `None` for any symbolic-shaped value, which the planner reports as
/// [`crate::PlanStatus::Deferred`] so the executor can re-plan once shapes
/// resolve.
+ '_