pub struct ShapeProto {
pub element_type: i32,
pub dimensions: Vec<i64>,
pub tuple_shapes: Vec<ShapeProto>,
pub layout: Option<Box<LayoutProto>>,
pub is_dynamic_dimension: Vec<bool>,
}Expand description
A shape describes the number of dimensions in the array, the size of each dimension, and the primitive component type.
Tuples are a special case in that they have rank zero and have tuple_shapes defined.
See the XLA documentation for more information on shapes and layouts.
LINT.IfChange
Fields§
§element_type: i32The element type for this shape.
dimensions: Vec<i64>The size (number of elements) for each dimension, or an upper bound on the size if the dimension is dynamic. In XLA, dimensions are numbered from 0 to N-1 for an N-dimensional array. The first element of ‘dimensions’ is the size of dimension 0, the second element is the size of dimension 1, and so forth. Empty list indicates a scalar.
If the respective element in ‘is_dimension_dynamic’ is true then the value in this field represents an upper bound on the size of the dimension.
tuple_shapes: Vec<ShapeProto>For tuples only, the shapes of constituent shapes in the tuple sequence.
layout: Option<Box<LayoutProto>>The layout used to back this shape.
is_dynamic_dimension: Vec<bool>For arrays, this indicates whether or not each dimension is dynamically-sized. The number of elements in this repeated field should be zero (indicating that no dimensions are dynamic) or equal to the number of elements in the ‘dimensions’ field.
Implementations§
Source§impl ShapeProto
impl ShapeProto
Sourcepub fn element_type(&self) -> PrimitiveType
pub fn element_type(&self) -> PrimitiveType
Returns the enum value of element_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_element_type(&mut self, value: PrimitiveType)
pub fn set_element_type(&mut self, value: PrimitiveType)
Sets element_type to the provided enum value.
Trait Implementations§
Source§impl Clone for ShapeProto
impl Clone for ShapeProto
Source§fn clone(&self) -> ShapeProto
fn clone(&self) -> ShapeProto
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShapeProto
impl Debug for ShapeProto
Source§impl Default for ShapeProto
impl Default for ShapeProto
Source§impl Message for ShapeProto
impl Message for ShapeProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ShapeProto
impl PartialEq for ShapeProto
impl StructuralPartialEq for ShapeProto
Auto Trait Implementations§
impl Freeze for ShapeProto
impl RefUnwindSafe for ShapeProto
impl Send for ShapeProto
impl Sync for ShapeProto
impl Unpin for ShapeProto
impl UnwindSafe for ShapeProto
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)