GpuParallelOp

Trait GpuParallelOp 

Source
pub trait GpuParallelOp<T: Float + Send + Sync + Clone + 'static>: ParallelOp<T> {
    // Required methods
    fn gpu_elementwise_op<F>(
        &self,
        other: &Tensor<T>,
        op: F,
    ) -> RusTorchResult<Tensor<T>>
       where F: Fn(T, T) -> T + Send + Sync + Clone + 'static;
    fn gpu_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>;
    fn gpu_reduce<F, R>(
        &self,
        dim: usize,
        init: R,
        op: F,
    ) -> RusTorchResult<Tensor<T>>
       where F: Fn(R, T) -> R + Send + Sync + Clone,
             R: Send + Sync + Clone + Into<T>;
    fn to_device(&self, device: DeviceType) -> RusTorchResult<Tensor<T>>;
    fn to_cpu(&self) -> RusTorchResult<Tensor<T>>;
}
Expand description

GPU並列操作のトレイト Trait for GPU parallel operations

Required Methods§

Source

fn gpu_elementwise_op<F>( &self, other: &Tensor<T>, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(T, T) -> T + Send + Sync + Clone + 'static,

GPU上での並列要素ごと演算 Parallel element-wise operations on GPU

Source

fn gpu_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>

GPU上での並列行列乗算 Parallel matrix multiplication on GPU

Source

fn gpu_reduce<F, R>( &self, dim: usize, init: R, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(R, T) -> R + Send + Sync + Clone, R: Send + Sync + Clone + Into<T>,

Perform parallel reduction on GPU GPU上で並列リダクションを実行

Source

fn to_device(&self, device: DeviceType) -> RusTorchResult<Tensor<T>>

GPU-CPU間データ転送 Data transfer between GPU and CPU

Source

fn to_cpu(&self) -> RusTorchResult<Tensor<T>>

Transfer tensor data from GPU to CPU テンソルデータをGPUからCPUに転送

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> GpuParallelOp<T> for Tensor<T>
where T: Float + Send + Sync + Clone + 'static + Debug + FromPrimitive + ScalarOperand,

Available on non-crate feature cuda only.