pub struct SliceStaticLayerParams {
pub begin_ids: Vec<i64>,
pub begin_masks: Vec<bool>,
pub end_ids: Vec<i64>,
pub end_masks: Vec<bool>,
pub strides: Vec<i64>,
pub squeeze_masks: Vec<bool>,
}Expand description
A layer that extracts a slice of size (end - begin) / stride
from the given input tensor.
Support negative indexing and negative strides.
Requires 1 input and produces 1 output. Output rank is same as the input rank.
Value of beginIds, beginMasks, endIds, endMasks, strides are required parameters. Lengths of all the parameters must equal the rank of the input.
i-th element of “beginIds” is ignored and assumed to be 0 if the i-th element of “beginMasks” is True
i-th element of “endIds” is ignored and assumed to be -1 if the i-th element of “endMasks” is True
e.g.: if i-th element of “squeezeMasks” is set to True, only beginIds[i] would be sliced out, and all other masks and inputs are ignored.
e.g. (without squeezeMasks): input shape: (5, 5, 5) beginIds: [1, 2, 3] beginMasks: [True, False, True] endIds: [3, -3, 2] endMasks: [False, True, True] strides: [2, 2, 2] SqueezeMasks: [False, False, False] output shape: (2, 2, 3) This is equivalent to input[:3:2, 2::2, ::2]
e.g. (with squeezeMasks): input shape: (5, 5, 5) beginIds: [1, 2, 3] beginMasks: [True, False, True] endIds: [3, -3, 2] endMasks: [False, True, True] strides: [2, 2, 2] SqueezeMasks: [False, True, False] output shape: (2, 3) This is equivalent to input[:3:2, 2, ::2]
Fields§
§begin_ids: Vec<i64>§begin_masks: Vec<bool>§end_ids: Vec<i64>§end_masks: Vec<bool>§strides: Vec<i64>§squeeze_masks: Vec<bool>Trait Implementations§
Source§impl Clone for SliceStaticLayerParams
impl Clone for SliceStaticLayerParams
Source§fn clone(&self) -> SliceStaticLayerParams
fn clone(&self) -> SliceStaticLayerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SliceStaticLayerParams
impl Debug for SliceStaticLayerParams
Source§impl Default for SliceStaticLayerParams
impl Default for SliceStaticLayerParams
Source§impl Hash for SliceStaticLayerParams
impl Hash for SliceStaticLayerParams
Source§impl Message for SliceStaticLayerParams
impl Message for SliceStaticLayerParams
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 SliceStaticLayerParams
impl PartialEq for SliceStaticLayerParams
Source§fn eq(&self, other: &SliceStaticLayerParams) -> bool
fn eq(&self, other: &SliceStaticLayerParams) -> bool
self and other values to be equal, and is used by ==.