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§
Sourcefn gpu_elementwise_op<F>(
&self,
other: &Tensor<T>,
op: F,
) -> RusTorchResult<Tensor<T>>
fn gpu_elementwise_op<F>( &self, other: &Tensor<T>, op: F, ) -> RusTorchResult<Tensor<T>>
GPU上での並列要素ごと演算 Parallel element-wise operations on GPU
Sourcefn gpu_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>
fn gpu_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>
GPU上での並列行列乗算 Parallel matrix multiplication on GPU
Sourcefn gpu_reduce<F, R>(
&self,
dim: usize,
init: R,
op: F,
) -> RusTorchResult<Tensor<T>>
fn gpu_reduce<F, R>( &self, dim: usize, init: R, op: F, ) -> RusTorchResult<Tensor<T>>
Perform parallel reduction on GPU GPU上で並列リダクションを実行
Sourcefn to_device(&self, device: DeviceType) -> RusTorchResult<Tensor<T>>
fn to_device(&self, device: DeviceType) -> RusTorchResult<Tensor<T>>
GPU-CPU間データ転送 Data transfer between GPU and CPU
Sourcefn to_cpu(&self) -> RusTorchResult<Tensor<T>>
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§
impl<T> GpuParallelOp<T> for Tensor<T>
Available on non-crate feature
cuda only.