pub struct LayoutProto {
pub format: i32,
pub minor_to_major: Vec<i64>,
pub max_sparse_elements: i64,
pub tiles: Vec<TileProto>,
pub element_size_in_bits: i64,
pub memory_space: i64,
}Expand description
A layout describes how the array is placed in (1D) memory space. This includes the minor-to-major ordering of dimensions within a shape.
Clients must specify the layouts of input Literals to the computation. Layouts specified in interior operations which take Shapes (for example, Convert) are ignored.
See the XLA documentation for more information on shapes and layouts.
LINT.IfChange
Fields§
§format: i32The method used to store the data in memory. The format determines which of the other fields are used by the layout.
minor_to_major: Vec<i64>Sequence of dimension numbers, from minor (fastest varying index) to major (slowest varying index). This field is required.
max_sparse_elements: i64The maximum number of elements that can be stored for SPARSE formats. This can be used to determine the maximum size in bytes of arrays stored in memory. This field must be unset unless the format is SPARSE.
tiles: Vec<TileProto>A sequence of tiles, starting from the tile that’s applied first to the Shape.
TODO(b/119839262): implement tiling in each backend or add Unimplemented error.
element_size_in_bits: i64Bit size of each element. If the size is bigger than what the element type requires, the value is stored in the least significant bits and the additional most significant bits are filled with 0’s.
TODO(b/119839262): implement in each backend or add Unimplemented error.
memory_space: i64Memory space where this array resides. The integer field is interpreted in a backend-specific manner.
Implementations§
Source§impl LayoutProto
impl LayoutProto
Trait Implementations§
Source§impl Clone for LayoutProto
impl Clone for LayoutProto
Source§fn clone(&self) -> LayoutProto
fn clone(&self) -> LayoutProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutProto
impl Debug for LayoutProto
Source§impl Default for LayoutProto
impl Default for LayoutProto
Source§impl Message for LayoutProto
impl Message for LayoutProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.