numr/ops/cpu/
cumulative.rs1use crate::error::Result;
4use crate::ops::CumulativeOps;
5use crate::runtime::cpu::{
6 CpuClient, CpuRuntime,
7 helpers::{cumprod_impl, cumsum_impl, logsumexp_impl},
8};
9use crate::tensor::Tensor;
10
11impl CumulativeOps<CpuRuntime> for CpuClient {
13 fn cumsum(&self, a: &Tensor<CpuRuntime>, dim: isize) -> Result<Tensor<CpuRuntime>> {
14 cumsum_impl(self, a, dim)
15 }
16
17 fn cumprod(&self, a: &Tensor<CpuRuntime>, dim: isize) -> Result<Tensor<CpuRuntime>> {
18 cumprod_impl(self, a, dim)
19 }
20
21 fn logsumexp(
22 &self,
23 a: &Tensor<CpuRuntime>,
24 dims: &[usize],
25 keepdim: bool,
26 ) -> Result<Tensor<CpuRuntime>> {
27 logsumexp_impl(self, a, dims, keepdim)
28 }
29}