Struct GraphBindings
pub struct GraphBindings {
pub tensors: Vec<(TensorId, TensorId)>,
pub shapes: Vec<usize>,
pub scalars: Vec<ScalarIr>,
pub ranges: Vec<Slice>,
}Expand description
Per-invocation bindings used to specialize a cached graph to concrete tensors.
The cached graph is in relative form (positional tensor ids, relative shape-dim ids, scalar
placeholders). The bindings carry only the graph’s boundary — its inputs and surviving
outputs — plus the dense shape-dim table and the scalar values. The replay reconstructs the
concrete shape of every tensor (including intermediates) from shapes, and
allocates fresh ids for intermediate tensors itself, so the payload stays small regardless of
how many ops the graph contains.
Fields§
§tensors: Vec<(TensorId, TensorId)>Boundary tensors only: (relative id, concrete id) for each graph input and surviving
output. Intermediate tensors are not listed — the replaying backend allocates their ids.
shapes: Vec<usize>Concrete dim value for each relative shape-dim id, indexed directly by the id. Relative dim
ids are dense (0..N), so this is a plain table rather than a map, and each distinct dim
value appears once however many tensors share it. Lets the replay rebuild every tensor’s
concrete shape — inputs, outputs and intermediates alike.
scalars: Vec<ScalarIr>Concrete scalar values indexed by their placeholder id (the value carried in a relativized
ScalarIr::UInt(placeholder)).
ranges: Vec<Slice>Concrete slice ranges indexed by their placeholder id (the value carried in a relativized
range’s start field). The relative graph keeps every Slice range as a positional
placeholder — its actual bounds are discarded by relativization (they vary per invocation,
like scalars) — so the replay restores each from here.
Trait Implementations§
§impl Clone for GraphBindings
impl Clone for GraphBindings
§fn clone(&self) -> GraphBindings
fn clone(&self) -> GraphBindings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for GraphBindings
impl Debug for GraphBindings
§impl<'de> Deserialize<'de> for GraphBindings
impl<'de> Deserialize<'de> for GraphBindings
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GraphBindings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GraphBindings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for GraphBindings
impl Serialize for GraphBindings
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for GraphBindings
impl RefUnwindSafe for GraphBindings
impl Send for GraphBindings
impl Sync for GraphBindings
impl Unpin for GraphBindings
impl UnsafeUnpin for GraphBindings
impl UnwindSafe for GraphBindings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more