pub struct StableHloModule { /* private fields */ }Expand description
StableHLO MLIR module text plus a deterministic fingerprint.
§Examples
use tenferro_xla::StableHloModule;
let module = StableHloModule::new("module {}".to_string());
assert_eq!(module.as_str(), "module {}");
assert_eq!(module.fingerprint().as_bytes().len(), 32);Implementations§
Source§impl StableHloModule
impl StableHloModule
Sourcepub fn new(text: String) -> Self
pub fn new(text: String) -> Self
Create a module wrapper and fingerprint its text.
§Examples
use tenferro_xla::StableHloModule;
let module = StableHloModule::new("module {}".to_string());
assert!(module.fingerprint().to_hex().len() == 64);Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Borrow the StableHLO MLIR text.
§Examples
use tenferro_xla::StableHloModule;
let module = StableHloModule::new("module {}".to_string());
assert!(module.as_str().starts_with("module"));Sourcepub fn fingerprint(&self) -> StableHloModuleFingerprint
pub fn fingerprint(&self) -> StableHloModuleFingerprint
Return the module fingerprint.
§Examples
use tenferro_xla::StableHloModule;
let module = StableHloModule::new("module {}".to_string());
let _fingerprint = module.fingerprint();Trait Implementations§
Source§impl Clone for StableHloModule
impl Clone for StableHloModule
Source§fn clone(&self) -> StableHloModule
fn clone(&self) -> StableHloModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StableHloModule
impl Debug for StableHloModule
Source§impl PartialEq for StableHloModule
impl PartialEq for StableHloModule
impl Eq for StableHloModule
impl StructuralPartialEq for StableHloModule
Auto Trait Implementations§
impl Freeze for StableHloModule
impl RefUnwindSafe for StableHloModule
impl Send for StableHloModule
impl Sync for StableHloModule
impl Unpin for StableHloModule
impl UnsafeUnpin for StableHloModule
impl UnwindSafe for StableHloModule
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.