pub struct StreamTensor(/* private fields */);
Expand description
A stream tensor is used in streaming module. It can either contain an actual tensor or be empty.
Implementations§
Source§impl StreamTensor
impl StreamTensor
pub fn empty() -> Self
pub fn from_tensor(tensor: Tensor) -> Self
pub fn shape(&self) -> Option<&Shape>
pub fn cat2<D: Dim>(&self, rhs: &Self, dim: D) -> Result<Self>
pub fn seq_len<D: Dim>(&self, dim: D) -> Result<usize>
pub fn reset(&mut self)
pub fn narrow<D: Dim>( &self, dim: D, offset: usize, len: usize, ) -> Result<StreamTensor>
Sourcepub fn split<D: Dim>(&self, dim: D, lhs_len: usize) -> Result<(Self, Self)>
pub fn split<D: Dim>(&self, dim: D, lhs_len: usize) -> Result<(Self, Self)>
Splits the Streaming Tensor on the time axis dim
with the first lhs_len
elements
returned in the first output and the remaining in the second output.
pub fn as_option(&self) -> Option<&Tensor>
pub fn apply<M: Module>(&self, m: &M) -> Result<Self>
Trait Implementations§
Source§impl Clone for StreamTensor
impl Clone for StreamTensor
Source§fn clone(&self) -> StreamTensor
fn clone(&self) -> StreamTensor
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StreamTensor
impl Debug for StreamTensor
Source§impl From<()> for StreamTensor
impl From<()> for StreamTensor
Auto Trait Implementations§
impl Freeze for StreamTensor
impl !RefUnwindSafe for StreamTensor
impl Send for StreamTensor
impl Sync for StreamTensor
impl Unpin for StreamTensor
impl !UnwindSafe for StreamTensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more