[][src]Struct tensorflow_proto::xla::LayoutProto

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,
}

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: i32

The 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: i64

The 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: i64

Bit 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: i64

Memory space where this array resides. The integer field is interpreted in a backend-specific manner.

Implementations

impl LayoutProto[src]

pub fn format(&self) -> Format[src]

Returns the enum value of format, or the default if the field is set to an invalid enum value.

pub fn set_format(&mut self, value: Format)[src]

Sets format to the provided enum value.

Trait Implementations

impl Clone for LayoutProto[src]

impl Debug for LayoutProto[src]

impl Default for LayoutProto[src]

impl Message for LayoutProto[src]

impl PartialEq<LayoutProto> for LayoutProto[src]

impl StructuralPartialEq for LayoutProto[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.