Skip to main content

InPlaceOps

Trait InPlaceOps 

Source
pub trait InPlaceOps {
    type Error;

    // Required methods
    fn can_do_inplace(
        &self,
        output_view: &TensorView,
        input_views: &[TensorView],
    ) -> bool;
    fn execute_inplace(
        &mut self,
        output_view: &TensorView,
        input_views: &[TensorView],
        mode: InPlaceMode,
    ) -> Result<(), Self::Error>;
}
Expand description

Trait for in-place operations

Required Associated Types§

Required Methods§

Source

fn can_do_inplace( &self, output_view: &TensorView, input_views: &[TensorView], ) -> bool

Check if in-place operation is safe

Source

fn execute_inplace( &mut self, output_view: &TensorView, input_views: &[TensorView], mode: InPlaceMode, ) -> Result<(), Self::Error>

Execute operation in-place if possible

Implementors§