pub struct LocalTensorLayout<P = TensorPlacement> { /* private fields */ }Expand description
Rank-local shape and placement for one planned physical tensor.
Implementations§
Source§impl<P> LocalTensorLayout<P>
impl<P> LocalTensorLayout<P>
Sourcepub fn new(
logical_name: impl Into<String>,
role: ParameterRole,
global_shape: Vec<usize>,
local_shape: Vec<usize>,
placement: P,
logical_units: Option<usize>,
logical_range: Option<Range<usize>>,
fell_back_to_replication: bool,
) -> Self
pub fn new( logical_name: impl Into<String>, role: ParameterRole, global_shape: Vec<usize>, local_shape: Vec<usize>, placement: P, logical_units: Option<usize>, logical_range: Option<Range<usize>>, fell_back_to_replication: bool, ) -> Self
Creates one validated-planner output entry.
Sourcepub fn logical_name(&self) -> &str
pub fn logical_name(&self) -> &str
Returns the logical parameter group name.
Sourcepub const fn role(&self) -> ParameterRole
pub const fn role(&self) -> ParameterRole
Returns the semantic parameter role.
Sourcepub fn global_shape(&self) -> &[usize]
pub fn global_shape(&self) -> &[usize]
Returns the checkpoint-global shape.
Sourcepub fn local_shape(&self) -> &[usize]
pub fn local_shape(&self) -> &[usize]
Returns the shape materialized on this rank.
Sourcepub fn logical_range(&self) -> Option<&Range<usize>>
pub fn logical_range(&self) -> Option<&Range<usize>>
Returns the rank-local range in the parameter group’s semantic domain.
Sourcepub const fn logical_units(&self) -> Option<usize>
pub const fn logical_units(&self) -> Option<usize>
Returns the size of the complete semantic partition domain.
Sourcepub const fn fell_back_to_replication(&self) -> bool
pub const fn fell_back_to_replication(&self) -> bool
Returns whether permissive planning replicated an unsupported shard.
Trait Implementations§
Source§impl<P: Clone> Clone for LocalTensorLayout<P>
impl<P: Clone> Clone for LocalTensorLayout<P>
Source§fn clone(&self) -> LocalTensorLayout<P>
fn clone(&self) -> LocalTensorLayout<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: Debug> Debug for LocalTensorLayout<P>
impl<P: Debug> Debug for LocalTensorLayout<P>
impl<P: Eq> Eq for LocalTensorLayout<P>
Source§impl<P: PartialEq> PartialEq for LocalTensorLayout<P>
impl<P: PartialEq> PartialEq for LocalTensorLayout<P>
impl<P: PartialEq> StructuralPartialEq for LocalTensorLayout<P>
Auto Trait Implementations§
impl<P> Freeze for LocalTensorLayout<P>where
P: Freeze,
impl<P> RefUnwindSafe for LocalTensorLayout<P>where
P: RefUnwindSafe,
impl<P> Send for LocalTensorLayout<P>where
P: Send,
impl<P> Sync for LocalTensorLayout<P>where
P: Sync,
impl<P> Unpin for LocalTensorLayout<P>where
P: Unpin,
impl<P> UnsafeUnpin for LocalTensorLayout<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for LocalTensorLayout<P>where
P: UnwindSafe,
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