Struct tract_pulse::internal::TypedFact
[−]pub struct TypedFact {
pub datum_type: DatumType,
pub shape: ShapeFact,
pub konst: Option<Arc<Tensor>>,
pub uniform: Option<Arc<Tensor>>,
}Expand description
Fully determined tensor information for TypedModel.
Fields
datum_type: DatumTypetensor element type
shape: ShapeFacttensor shape
konst: Option<Arc<Tensor>>optional constant value
uniform: Option<Arc<Tensor>>optional uniform value
Implementations
impl TypedFact
impl TypedFact
pub fn scalar<T>() -> TypedFact where
T: Datum,
pub fn shape<T, S>(shape: S) -> TypedFact where
T: Datum,
S: Into<ShapeFact>,
pub fn dt_scalar(datum_type: DatumType) -> TypedFact
pub fn dt_shape<S>(datum_type: DatumType, shape: S) -> TypedFact where
S: Into<ShapeFact>,
pub fn rank(&self) -> usize
pub fn format_dt_shape(&self) -> String
pub fn consistent(&self) -> Result<(), Error>
pub fn without_value(&self) -> TypedFact
Trait Implementations
impl Fact for TypedFact
impl Fact for TypedFact
fn to_typed_fact(&self) -> Result<Cow<'_, TypedFact>, Error>
fn matches(
&self,
t: &Tensor,
symbols: Option<&SymbolValues>
) -> Result<bool, Error>
fn same_as(&self, other: &(dyn Fact + 'static)) -> bool
fn compatible_with(&self, other: &(dyn Fact + 'static)) -> bool
fn compatible_with(&self, other: &(dyn Fact + 'static)) -> bool
Ensure that self is same type as another fact or a subtype
fn datum_type(&self) -> Option<DatumType>
sourceimpl<'a> From<&'a PulsedFact> for TypedFact
impl<'a> From<&'a PulsedFact> for TypedFact
sourcefn from(fact: &'a PulsedFact) -> TypedFact
fn from(fact: &'a PulsedFact) -> TypedFact
Converts to this type from the input type.
sourceimpl From<PulsedFact> for TypedFact
impl From<PulsedFact> for TypedFact
sourcefn from(fact: PulsedFact) -> TypedFact
fn from(fact: PulsedFact) -> TypedFact
Converts to this type from the input type.
impl SpecialOps<TypedFact, Box<dyn TypedOp + 'static, Global>> for Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>
impl SpecialOps<TypedFact, Box<dyn TypedOp + 'static, Global>> for Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>
fn is_source(op: &Box<dyn TypedOp + 'static, Global>) -> bool
fn create_dummy(&self) -> Box<dyn TypedOp + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn create_source(&self, fact: TypedFact) -> Box<dyn TypedOp + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn wire_node(
&mut self,
name: impl Into<String>,
op: impl Into<Box<dyn TypedOp + 'static, Global>>,
inputs: &[OutletId]
) -> Result<SmallVec<[OutletId; 4]>, Error>
impl Translate<TypedFact, Box<dyn TypedOp + 'static, Global>, TypedFact, Box<dyn TypedOp + 'static, Global>> for HalfTranslator
impl Translate<TypedFact, Box<dyn TypedOp + 'static, Global>, TypedFact, Box<dyn TypedOp + 'static, Global>> for HalfTranslator
fn translate_node(
&self,
_source: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
target: &mut Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
mapping: &HashMap<OutletId, OutletId, RandomState>
) -> Result<SmallVec<[OutletId; 4]>, Error>
fn translate_model(
&self,
source: &Graph<TI1, O1>
) -> Result<Graph<TI2, O2>, Error>
fn translate_model_with_mappings(
&self,
source: &Graph<TI1, O1>
) -> Result<(Graph<TI2, O2>, HashMap<OutletId, OutletId, RandomState>), Error>
impl Translate<TypedFact, Box<dyn TypedOp + 'static, Global>, TypedFact, Box<dyn TypedOp + 'static, Global>> for SymbolValues
impl Translate<TypedFact, Box<dyn TypedOp + 'static, Global>, TypedFact, Box<dyn TypedOp + 'static, Global>> for SymbolValues
fn translate_node(
&self,
source: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
target: &mut Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
mapping: &HashMap<OutletId, OutletId, RandomState>
) -> Result<SmallVec<[OutletId; 4]>, Error>
fn translate_model(
&self,
source: &Graph<TI1, O1>
) -> Result<Graph<TI2, O2>, Error>
fn translate_model_with_mappings(
&self,
source: &Graph<TI1, O1>
) -> Result<(Graph<TI2, O2>, HashMap<OutletId, OutletId, RandomState>), Error>
impl StructuralPartialEq for TypedFact
Auto Trait Implementations
impl RefUnwindSafe for TypedFact
impl Send for TypedFact
impl Sync for TypedFact
impl Unpin for TypedFact
impl UnwindSafe for TypedFact
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more