pub enum BatchableOp<T: TensorElement> {
Add(Arc<Tensor<T>>, Arc<Tensor<T>>),
Mul(Arc<Tensor<T>>, Arc<Tensor<T>>),
Sub(Arc<Tensor<T>>, Arc<Tensor<T>>),
Div(Arc<Tensor<T>>, Arc<Tensor<T>>),
AddScalar(Arc<Tensor<T>>, T),
MulScalar(Arc<Tensor<T>>, T),
ReLU(Arc<Tensor<T>>),
Sigmoid(Arc<Tensor<T>>),
Tanh(Arc<Tensor<T>>),
}Expand description
Type of tensor operation that can be batched
Variants§
Add(Arc<Tensor<T>>, Arc<Tensor<T>>)
Element-wise addition
Mul(Arc<Tensor<T>>, Arc<Tensor<T>>)
Element-wise multiplication
Sub(Arc<Tensor<T>>, Arc<Tensor<T>>)
Element-wise subtraction
Div(Arc<Tensor<T>>, Arc<Tensor<T>>)
Element-wise division
AddScalar(Arc<Tensor<T>>, T)
Scalar addition
MulScalar(Arc<Tensor<T>>, T)
Scalar multiplication
ReLU(Arc<Tensor<T>>)
ReLU activation
Sigmoid(Arc<Tensor<T>>)
Sigmoid activation
Tanh(Arc<Tensor<T>>)
Tanh activation
Implementations§
Source§impl<T: TensorElement> BatchableOp<T>
impl<T: TensorElement> BatchableOp<T>
Sourcepub fn device(&self) -> DeviceType
pub fn device(&self) -> DeviceType
Get the device type of the operation
Sourcepub fn should_batch(&self, config: &BatchingConfig) -> bool
pub fn should_batch(&self, config: &BatchingConfig) -> bool
Check if this operation should be batched based on config
Trait Implementations§
Source§impl<T: Clone + TensorElement> Clone for BatchableOp<T>
impl<T: Clone + TensorElement> Clone for BatchableOp<T>
Source§fn clone(&self) -> BatchableOp<T>
fn clone(&self) -> BatchableOp<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BatchableOp<T>where
T: Freeze,
impl<T> RefUnwindSafe for BatchableOp<T>where
T: RefUnwindSafe,
impl<T> Send for BatchableOp<T>
impl<T> Sync for BatchableOp<T>
impl<T> Unpin for BatchableOp<T>where
T: Unpin,
impl<T> UnsafeUnpin for BatchableOp<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for BatchableOp<T>where
T: UnwindSafe + RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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