pub struct Image {
pub layout: ImageLayout,
pub tensors: Vec<Placement>,
pub tiles: Vec<Tile>,
pub channel_lines: Vec<u64>,
}Expand description
A checkpoint laid out on the channels: its tensors in the order given, its tiles in that order, and the lines each channel holds.
Fields§
§layout: ImageLayout§tensors: Vec<Placement>§tiles: Vec<Tile>§channel_lines: Vec<u64>Implementations§
Source§impl Image
impl Image
Sourcepub fn channel_bytes(&self) -> Vec<u64>
pub fn channel_bytes(&self) -> Vec<u64>
Bytes each channel holds.
Sourcepub fn locate(&self, tensor: usize, row: u64) -> (u32, u64)
pub fn locate(&self, tensor: usize, row: u64) -> (u32, u64)
The channel and the byte within it where row row of tensor tensor (an index into Image::tensors)
starts: for a tensor laid block-major, where its block 0 is.
Sourcepub fn locate_block(&self, tensor: usize, row: u64, block: u64) -> (u32, u64)
pub fn locate_block(&self, tensor: usize, row: u64, block: u64) -> (u32, u64)
The channel and the byte within it where block block of row row of tensor tensor starts, for a tensor of
weight blocks (its row’s blocks one after another, or, laid block-major, the tile’s every row’s block before
any row’s next).
Sourcepub fn stored_rows(
&self,
tensor: usize,
source: &mut dyn WeightSource,
first: u64,
count: u64,
) -> Result<Vec<u8>>
pub fn stored_rows( &self, tensor: usize, source: &mut dyn WeightSource, first: u64, count: u64, ) -> Result<Vec<u8>>
The image’s rows [first, first + count) of tensor tensor, read from source: the pieces of the stored rows
they lie in.
Sourcepub fn fill(&self, source: &mut dyn WeightSource) -> Result<Vec<Vec<u8>>>
pub fn fill(&self, source: &mut dyn WeightSource) -> Result<Vec<Vec<u8>>>
The channels’ bytes, every tile’s rows read from source and its check word written.
Sourcepub fn write_channels(
&self,
source: &mut dyn WeightSource,
out: &mut [&mut dyn Write],
) -> Result<()>
pub fn write_channels( &self, source: &mut dyn WeightSource, out: &mut [&mut dyn Write], ) -> Result<()>
The bytes Image::fill gives each channel written to that channel’s writer in out, a tile at a time, so no
more than a tile is ever held: each channel takes its tiles in line order from line 0.
Sourcepub fn tile_table(&self) -> Vec<u8> ⓘ
pub fn tile_table(&self) -> Vec<u8> ⓘ
The tile table a host loads and scrubs the image by, little-endian 64-bit words after the eight bytes
LOGOSIMG: the format (1), the line’s bytes, whether tiles end in check words, the channels, each channel’s
lines, the tiles, and each tile’s channel, first line and lines.
Trait Implementations§
impl Eq for Image
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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
key and return true if they are equal.