pub struct SlidingWindowsLayerParams {
pub axis: i64,
pub window_size: u64,
pub step: u64,
}Expand description
A layer that returns a tensor containing all windows of size windowSize
separated by step along the dimension axis.
.. code::
y = SlidingWindows(x)Requires 1 input and produces 1 output.
Input An N-Dimensional tensor.
Output An (N+1)-Dimensional tensor.
This operation behaves as following: - if axis = 0 & input is rank 1 (L,). Output shape will be (M, W). - if axis = 1 & input is rank 3 (B1, L, C1). Output shape will be (B1, M, W, C1) - if axis = 2 & input is rank 5 (B1, B2, L, C1, C2) –> (B1 * B2, L, C1 * C2) –> (B1 * B2, M, W, C1 * C2). Output shape will be (B1, B2, M, W, C1, C2) - etc. where - L, C, B refer to input length, feature dimension length & batch size respectively - W is the window size. - M is the number of windows/slices calculated as M = (L - W) / step + 1
Fields§
§axis: i64§window_size: u64§step: u64Trait Implementations§
Source§impl Clone for SlidingWindowsLayerParams
impl Clone for SlidingWindowsLayerParams
Source§fn clone(&self) -> SlidingWindowsLayerParams
fn clone(&self) -> SlidingWindowsLayerParams
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 SlidingWindowsLayerParams
impl Debug for SlidingWindowsLayerParams
Source§impl Default for SlidingWindowsLayerParams
impl Default for SlidingWindowsLayerParams
Source§impl Hash for SlidingWindowsLayerParams
impl Hash for SlidingWindowsLayerParams
Source§impl Message for SlidingWindowsLayerParams
impl Message for SlidingWindowsLayerParams
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 SlidingWindowsLayerParams
impl PartialEq for SlidingWindowsLayerParams
Source§fn eq(&self, other: &SlidingWindowsLayerParams) -> bool
fn eq(&self, other: &SlidingWindowsLayerParams) -> bool
self and other values to be equal, and is used by ==.