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§
Sourcefn can_do_inplace(
&self,
output_view: &TensorView,
input_views: &[TensorView],
) -> bool
fn can_do_inplace( &self, output_view: &TensorView, input_views: &[TensorView], ) -> bool
Check if in-place operation is safe
Sourcefn execute_inplace(
&mut self,
output_view: &TensorView,
input_views: &[TensorView],
mode: InPlaceMode,
) -> Result<(), Self::Error>
fn execute_inplace( &mut self, output_view: &TensorView, input_views: &[TensorView], mode: InPlaceMode, ) -> Result<(), Self::Error>
Execute operation in-place if possible