Skip to main content

Copy

Trait Copy 

Source
pub trait Copy<F> {
    // Required methods
    fn copy(
        &self,
        x: &mut SharedTensor<F>,
        y: &mut SharedTensor<F>,
    ) -> Result<(), Error>;
    fn copy_plain(
        &self,
        x: &SharedTensor<F>,
        y: &mut SharedTensor<F>,
    ) -> Result<(), Error>;
}
Expand description

Provides the copy operation.

Required Methods§

Source

fn copy( &self, x: &mut SharedTensor<F>, y: &mut SharedTensor<F>, ) -> Result<(), Error>

Copies x.len() elements of vector x into vector y with complete memory management.

Saves the result to y. This is a Level 1 BLAS operation.

For a no-memory managed version see copy_plain.

Source

fn copy_plain( &self, x: &SharedTensor<F>, y: &mut SharedTensor<F>, ) -> Result<(), Error>

Copies x.len() elements of vector x into vector y without any memory management.

Saves the result to y. This is a Level 1 BLAS operation.

Attention:
For a correct computation result, you need to manage the memory allocation and synchronization yourself.
For a memory managed version see copy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Copy<f32> for Backend<Cuda>

Source§

fn copy( &self, x: &mut SharedTensor<f32>, y: &mut SharedTensor<f32>, ) -> Result<(), Error>

Source§

fn copy_plain( &self, x: &SharedTensor<f32>, y: &mut SharedTensor<f32>, ) -> Result<(), Error>

Source§

impl Copy<f32> for Backend<Native>

Source§

fn copy( &self, x: &mut SharedTensor<f32>, y: &mut SharedTensor<f32>, ) -> Result<(), Error>

Source§

fn copy_plain( &self, x: &SharedTensor<f32>, y: &mut SharedTensor<f32>, ) -> Result<(), Error>

Source§

impl Copy<f64> for Backend<Native>

Source§

fn copy( &self, x: &mut SharedTensor<f64>, y: &mut SharedTensor<f64>, ) -> Result<(), Error>

Source§

fn copy_plain( &self, x: &SharedTensor<f64>, y: &mut SharedTensor<f64>, ) -> Result<(), Error>

Implementors§