pub struct CpuRuntime;Expand description
CPU compute runtime
This is the default runtime that works on any platform. Memory is allocated on the heap using the system allocator.
Trait Implementations§
Source§impl ActivationOps<CpuRuntime> for CpuClient
ActivationOps implementation for CPU runtime.
impl ActivationOps<CpuRuntime> for CpuClient
ActivationOps implementation for CPU runtime.
Source§fn relu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn relu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sigmoid(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sigmoid(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn silu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn silu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gelu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn gelu(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn silu_mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn silu_mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
silu(a) * b in a single pass. Read moreSource§fn gelu_mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gelu_mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
gelu(a) * b in a single pass. Read moreSource§fn relu_mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn relu_mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
relu(a) * b in a single pass. Read moreSource§fn sigmoid_mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn sigmoid_mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
sigmoid(a) * b in a single pass. Read moreSource§fn silu_mul_bwd(
&self,
grad: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn silu_mul_bwd( &self, grad: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
output = silu(a) * b. Read moreSource§fn gelu_mul_bwd(
&self,
grad: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn gelu_mul_bwd( &self, grad: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
output = gelu(a) * b. Read moreSource§fn relu_mul_bwd(
&self,
grad: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn relu_mul_bwd( &self, grad: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
output = relu(a) * b. Read moreSource§fn sigmoid_mul_bwd(
&self,
grad: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn sigmoid_mul_bwd( &self, grad: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
output = sigmoid(a) * b. Read moreSource§fn leaky_relu(
&self,
a: &Tensor<CpuRuntime>,
negative_slope: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn leaky_relu( &self, a: &Tensor<CpuRuntime>, negative_slope: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn elu(
&self,
a: &Tensor<CpuRuntime>,
alpha: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn elu( &self, a: &Tensor<CpuRuntime>, alpha: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn softmax(
&self,
a: &Tensor<CpuRuntime>,
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn softmax( &self, a: &Tensor<CpuRuntime>, dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn softmax_bwd(
&self,
grad: &Tensor<CpuRuntime>,
output: &Tensor<CpuRuntime>,
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn softmax_bwd( &self, grad: &Tensor<CpuRuntime>, output: &Tensor<CpuRuntime>, dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn softplus(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn softplus(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
log(1 + exp(a)) Read moreSource§fn log_softmax(
&self,
a: &Tensor<CpuRuntime>,
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn log_softmax( &self, a: &Tensor<CpuRuntime>, dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl AdvancedRandomOps<CpuRuntime> for CpuClient
AdvancedRandomOps implementation for CPU runtime.
impl AdvancedRandomOps<CpuRuntime> for CpuClient
AdvancedRandomOps implementation for CPU runtime.
Source§fn philox_randn(
&self,
shape: &[usize],
key: u64,
counter: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn philox_randn( &self, shape: &[usize], key: u64, counter: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn philox_uniform(
&self,
shape: &[usize],
key: u64,
counter: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn philox_uniform( &self, shape: &[usize], key: u64, counter: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn threefry_randn(
&self,
shape: &[usize],
key: u64,
counter: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn threefry_randn( &self, shape: &[usize], key: u64, counter: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn threefry_uniform(
&self,
shape: &[usize],
key: u64,
counter: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn threefry_uniform( &self, shape: &[usize], key: u64, counter: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pcg64_randn(
&self,
shape: &[usize],
seed: u64,
stream: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn pcg64_randn( &self, shape: &[usize], seed: u64, stream: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pcg64_uniform(
&self,
shape: &[usize],
seed: u64,
stream: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn pcg64_uniform( &self, shape: &[usize], seed: u64, stream: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn xoshiro256_randn(
&self,
shape: &[usize],
seed: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn xoshiro256_randn( &self, shape: &[usize], seed: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn xoshiro256_uniform(
&self,
shape: &[usize],
seed: u64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn xoshiro256_uniform( &self, shape: &[usize], seed: u64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl AlibiOps<CpuRuntime> for CpuClient
impl AlibiOps<CpuRuntime> for CpuClient
Source§impl AttentionOps<CpuRuntime> for CpuClient
impl AttentionOps<CpuRuntime> for CpuClient
fn multi_head_attention( &self, q: &Var<CpuRuntime>, k: &Var<CpuRuntime>, v: &Var<CpuRuntime>, mask: Option<&Var<CpuRuntime>>, num_heads: usize, ) -> Result<Var<CpuRuntime>>
Source§impl BinaryOps<CpuRuntime> for CpuClient
BinaryOps implementation for CPU runtime.
impl BinaryOps<CpuRuntime> for CpuClient
BinaryOps implementation for CPU runtime.
Source§fn add(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn add( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sub(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn sub( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn div(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn div( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pow(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn pow( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn maximum(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn maximum( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn minimum(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn minimum( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn atan2(
&self,
y: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn atan2( &self, y: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fused_mul_add(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
c: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn fused_mul_add( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, c: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fused_add_mul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
c: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn fused_add_mul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, c: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl CalibrationOps<CpuRuntime> for CpuClient
impl CalibrationOps<CpuRuntime> for CpuClient
Source§fn awq_channel_scores(
&self,
activations: &Tensor<CpuRuntime>,
weights: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn awq_channel_scores( &self, activations: &Tensor<CpuRuntime>, weights: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn fisher_information(
&self,
gradients: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn fisher_information( &self, gradients: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn gptq_hessian_update(
&self,
hessian: &Tensor<CpuRuntime>,
x_block: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn gptq_hessian_update( &self, hessian: &Tensor<CpuRuntime>, x_block: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn gptq_quantize_column(
&self,
weight: &Tensor<CpuRuntime>,
h_inv: &Tensor<CpuRuntime>,
num_bits: u32,
group_size: u32,
symmetric: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn gptq_quantize_column( &self, weight: &Tensor<CpuRuntime>, h_inv: &Tensor<CpuRuntime>, num_bits: u32, group_size: u32, symmetric: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§impl Clone for CpuRuntime
impl Clone for CpuRuntime
Source§fn clone(&self) -> CpuRuntime
fn clone(&self) -> CpuRuntime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CompareOps<CpuRuntime> for CpuClient
impl CompareOps<CpuRuntime> for CpuClient
Source§fn eq(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn eq( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ne(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn ne( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn lt(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn lt( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn le(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn le( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gt(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gt( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ge(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn ge( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl ComplexOps<CpuRuntime> for CpuClient
ComplexOps implementation for CPU runtime.
impl ComplexOps<CpuRuntime> for CpuClient
ComplexOps implementation for CPU runtime.
Source§fn conj(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn conj(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn real(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn real(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn imag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn imag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn angle(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn angle(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn make_complex(
&self,
real: &Tensor<CpuRuntime>,
imag: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn make_complex( &self, real: &Tensor<CpuRuntime>, imag: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn complex_mul_real(
&self,
complex: &Tensor<CpuRuntime>,
real: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn complex_mul_real( &self, complex: &Tensor<CpuRuntime>, real: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn complex_div_real(
&self,
complex: &Tensor<CpuRuntime>,
real: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn complex_div_real( &self, complex: &Tensor<CpuRuntime>, real: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl ConditionalOps<CpuRuntime> for CpuClient
ConditionalOps implementation for CPU runtime.
impl ConditionalOps<CpuRuntime> for CpuClient
ConditionalOps implementation for CPU runtime.
Source§fn where_cond(
&self,
cond: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
y: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn where_cond( &self, cond: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, y: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl ConvOps<CpuRuntime> for CpuClient
impl ConvOps<CpuRuntime> for CpuClient
Source§fn conv1d(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: Option<&Tensor<CpuRuntime>>,
stride: usize,
padding: PaddingMode,
dilation: usize,
groups: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn conv1d( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: Option<&Tensor<CpuRuntime>>, stride: usize, padding: PaddingMode, dilation: usize, groups: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn conv2d(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: Option<&Tensor<CpuRuntime>>,
stride: (usize, usize),
padding: PaddingMode,
dilation: (usize, usize),
groups: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn conv2d( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: Option<&Tensor<CpuRuntime>>, stride: (usize, usize), padding: PaddingMode, dilation: (usize, usize), groups: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn depthwise_conv2d(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: Option<&Tensor<CpuRuntime>>,
stride: (usize, usize),
padding: PaddingMode,
dilation: (usize, usize),
) -> Result<Tensor<CpuRuntime>, Error>
fn depthwise_conv2d( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: Option<&Tensor<CpuRuntime>>, stride: (usize, usize), padding: PaddingMode, dilation: (usize, usize), ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl CumulativeOps<CpuRuntime> for CpuClient
CumulativeOps implementation for CPU runtime.
impl CumulativeOps<CpuRuntime> for CpuClient
CumulativeOps implementation for CPU runtime.
Source§impl Debug for CpuRuntime
impl Debug for CpuRuntime
Source§impl Default for CpuRuntime
impl Default for CpuRuntime
Source§fn default() -> CpuRuntime
fn default() -> CpuRuntime
Source§impl DequantOps<CpuRuntime> for CpuClient
impl DequantOps<CpuRuntime> for CpuClient
Source§fn nf4_dequant(
&self,
nf4_data: &Tensor<CpuRuntime>,
absmax: &Tensor<CpuRuntime>,
blocksize: usize,
) -> Result<Tensor<CpuRuntime>>
fn nf4_dequant( &self, nf4_data: &Tensor<CpuRuntime>, absmax: &Tensor<CpuRuntime>, blocksize: usize, ) -> Result<Tensor<CpuRuntime>>
Source§fn nf4_gemm(
&self,
input: &Tensor<CpuRuntime>,
nf4_weight: &Tensor<CpuRuntime>,
absmax: &Tensor<CpuRuntime>,
n_out: usize,
k: usize,
blocksize: usize,
) -> Result<Tensor<CpuRuntime>>
fn nf4_gemm( &self, input: &Tensor<CpuRuntime>, nf4_weight: &Tensor<CpuRuntime>, absmax: &Tensor<CpuRuntime>, n_out: usize, k: usize, blocksize: usize, ) -> Result<Tensor<CpuRuntime>>
Source§fn dequantize(
&self,
qt: &QuantTensor<CpuRuntime>,
target_dtype: DType,
) -> Result<Tensor<CpuRuntime>>
fn dequantize( &self, qt: &QuantTensor<CpuRuntime>, target_dtype: DType, ) -> Result<Tensor<CpuRuntime>>
Source§impl DistanceOps<CpuRuntime> for CpuClient
impl DistanceOps<CpuRuntime> for CpuClient
Source§fn cdist(
&self,
x: &Tensor<CpuRuntime>,
y: &Tensor<CpuRuntime>,
metric: DistanceMetric,
) -> Result<Tensor<CpuRuntime>, Error>
fn cdist( &self, x: &Tensor<CpuRuntime>, y: &Tensor<CpuRuntime>, metric: DistanceMetric, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pdist(
&self,
x: &Tensor<CpuRuntime>,
metric: DistanceMetric,
) -> Result<Tensor<CpuRuntime>, Error>
fn pdist( &self, x: &Tensor<CpuRuntime>, metric: DistanceMetric, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn squareform(
&self,
condensed: &Tensor<CpuRuntime>,
n: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn squareform( &self, condensed: &Tensor<CpuRuntime>, n: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn squareform_inverse(
&self,
square: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn squareform_inverse( &self, square: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl EinsumOps<CpuRuntime> for CpuClient
impl EinsumOps<CpuRuntime> for CpuClient
Source§impl FftAlgorithms<CpuRuntime> for CpuClient
impl FftAlgorithms<CpuRuntime> for CpuClient
Source§fn fft(
&self,
input: &Tensor<CpuRuntime>,
direction: FftDirection,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn fft( &self, input: &Tensor<CpuRuntime>, direction: FftDirection, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fft_dim(
&self,
input: &Tensor<CpuRuntime>,
dim: isize,
direction: FftDirection,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn fft_dim( &self, input: &Tensor<CpuRuntime>, dim: isize, direction: FftDirection, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn rfft(
&self,
input: &Tensor<CpuRuntime>,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn rfft( &self, input: &Tensor<CpuRuntime>, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn irfft(
&self,
input: &Tensor<CpuRuntime>,
n: Option<usize>,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn irfft( &self, input: &Tensor<CpuRuntime>, n: Option<usize>, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fft2(
&self,
input: &Tensor<CpuRuntime>,
direction: FftDirection,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn fft2( &self, input: &Tensor<CpuRuntime>, direction: FftDirection, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn rfft2(
&self,
input: &Tensor<CpuRuntime>,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn rfft2( &self, input: &Tensor<CpuRuntime>, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn irfft2(
&self,
input: &Tensor<CpuRuntime>,
s: Option<(usize, usize)>,
norm: FftNormalization,
) -> Result<Tensor<CpuRuntime>, Error>
fn irfft2( &self, input: &Tensor<CpuRuntime>, s: Option<(usize, usize)>, norm: FftNormalization, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fftshift(
&self,
input: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn fftshift( &self, input: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ifftshift(
&self,
input: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn ifftshift( &self, input: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl FlashAttentionOps<CpuRuntime> for CpuClient
impl FlashAttentionOps<CpuRuntime> for CpuClient
Source§fn flash_attention_fwd(
&self,
q: &Tensor<CpuRuntime>,
k: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
num_heads: usize,
num_kv_heads: usize,
head_dim: usize,
causal: bool,
window_size: usize,
kv_seq_len: Option<usize>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn flash_attention_fwd( &self, q: &Tensor<CpuRuntime>, k: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, num_heads: usize, num_kv_heads: usize, head_dim: usize, causal: bool, window_size: usize, kv_seq_len: Option<usize>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn flash_attention_fwd_fp8(
&self,
_q: &Tensor<CpuRuntime>,
_k: &Tensor<CpuRuntime>,
_v: &Tensor<CpuRuntime>,
_num_heads: usize,
_num_kv_heads: usize,
_head_dim: usize,
_causal: bool,
_q_scale: f32,
_k_scale: f32,
_v_scale: f32,
_o_scale: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn flash_attention_fwd_fp8( &self, _q: &Tensor<CpuRuntime>, _k: &Tensor<CpuRuntime>, _v: &Tensor<CpuRuntime>, _num_heads: usize, _num_kv_heads: usize, _head_dim: usize, _causal: bool, _q_scale: f32, _k_scale: f32, _v_scale: f32, _o_scale: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn flash_attention_bwd(
&self,
dout: &Tensor<CpuRuntime>,
q: &Tensor<CpuRuntime>,
k: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
output: &Tensor<CpuRuntime>,
lse: &Tensor<CpuRuntime>,
num_heads: usize,
num_kv_heads: usize,
_head_dim: usize,
causal: bool,
window_size: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn flash_attention_bwd( &self, dout: &Tensor<CpuRuntime>, q: &Tensor<CpuRuntime>, k: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, output: &Tensor<CpuRuntime>, lse: &Tensor<CpuRuntime>, num_heads: usize, num_kv_heads: usize, _head_dim: usize, causal: bool, window_size: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn flash_attention_bwd_fp8(
&self,
_dout: &Tensor<CpuRuntime>,
_q: &Tensor<CpuRuntime>,
_k: &Tensor<CpuRuntime>,
_v: &Tensor<CpuRuntime>,
_output: &Tensor<CpuRuntime>,
_lse: &Tensor<CpuRuntime>,
_num_heads: usize,
_num_kv_heads: usize,
_head_dim: usize,
_causal: bool,
_q_scale: f32,
_k_scale: f32,
_v_scale: f32,
_do_scale: f32,
_o_scale: f32,
_dq_scale: f32,
_dk_scale: f32,
_dv_scale: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn flash_attention_bwd_fp8( &self, _dout: &Tensor<CpuRuntime>, _q: &Tensor<CpuRuntime>, _k: &Tensor<CpuRuntime>, _v: &Tensor<CpuRuntime>, _output: &Tensor<CpuRuntime>, _lse: &Tensor<CpuRuntime>, _num_heads: usize, _num_kv_heads: usize, _head_dim: usize, _causal: bool, _q_scale: f32, _k_scale: f32, _v_scale: f32, _do_scale: f32, _o_scale: f32, _dq_scale: f32, _dk_scale: f32, _dv_scale: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§impl FusedFp8TrainingOps<CpuRuntime> for CpuClient
impl FusedFp8TrainingOps<CpuRuntime> for CpuClient
Source§fn fused_grad_unscale_clip(
&self,
grad: &Tensor<CpuRuntime>,
max_norm: f64,
loss_scale: f64,
) -> Result<(Tensor<CpuRuntime>, f64, bool)>
fn fused_grad_unscale_clip( &self, grad: &Tensor<CpuRuntime>, max_norm: f64, loss_scale: f64, ) -> Result<(Tensor<CpuRuntime>, f64, bool)>
Source§impl FusedOptimizerOps<CpuRuntime> for CpuClient
impl FusedOptimizerOps<CpuRuntime> for CpuClient
Source§fn fused_adamw_step(
&self,
param: &Tensor<CpuRuntime>,
grad: &Tensor<CpuRuntime>,
m: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
lr: f64,
beta1: f64,
beta2: f64,
eps: f64,
wd: f64,
step_size: f64,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_adamw_step( &self, param: &Tensor<CpuRuntime>, grad: &Tensor<CpuRuntime>, m: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, lr: f64, beta1: f64, beta2: f64, eps: f64, wd: f64, step_size: f64, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn fused_sgd_step(
&self,
param: &Tensor<CpuRuntime>,
grad: &Tensor<CpuRuntime>,
momentum_buf: Option<&Tensor<CpuRuntime>>,
lr: f64,
momentum: f64,
dampening: f64,
wd: f64,
nesterov: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_sgd_step( &self, param: &Tensor<CpuRuntime>, grad: &Tensor<CpuRuntime>, momentum_buf: Option<&Tensor<CpuRuntime>>, lr: f64, momentum: f64, dampening: f64, wd: f64, nesterov: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn fused_adagrad_step(
&self,
param: &Tensor<CpuRuntime>,
grad: &Tensor<CpuRuntime>,
accum: &Tensor<CpuRuntime>,
lr: f64,
eps: f64,
wd: f64,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_adagrad_step( &self, param: &Tensor<CpuRuntime>, grad: &Tensor<CpuRuntime>, accum: &Tensor<CpuRuntime>, lr: f64, eps: f64, wd: f64, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn fused_lamb_step(
&self,
param: &Tensor<CpuRuntime>,
grad: &Tensor<CpuRuntime>,
m: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
beta1: f64,
beta2: f64,
eps: f64,
wd: f64,
bias_corr1: f64,
bias_corr2: f64,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_lamb_step( &self, param: &Tensor<CpuRuntime>, grad: &Tensor<CpuRuntime>, m: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, beta1: f64, beta2: f64, eps: f64, wd: f64, bias_corr1: f64, bias_corr2: f64, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn fused_multi_tensor_adamw(
&self,
groups: &[(&Tensor<CpuRuntime>, &Tensor<CpuRuntime>, &Tensor<CpuRuntime>, &Tensor<CpuRuntime>)],
lr: f64,
beta1: f64,
beta2: f64,
eps: f64,
wd: f64,
step_size: f64,
) -> Result<Vec<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>>
fn fused_multi_tensor_adamw( &self, groups: &[(&Tensor<CpuRuntime>, &Tensor<CpuRuntime>, &Tensor<CpuRuntime>, &Tensor<CpuRuntime>)], lr: f64, beta1: f64, beta2: f64, eps: f64, wd: f64, step_size: f64, ) -> Result<Vec<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>>
Source§impl FusedQkvOps<CpuRuntime> for CpuClient
impl FusedQkvOps<CpuRuntime> for CpuClient
Source§fn fused_qkv_projection(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: Option<&Tensor<CpuRuntime>>,
num_heads: usize,
num_kv_heads: usize,
head_dim: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_qkv_projection( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: Option<&Tensor<CpuRuntime>>, num_heads: usize, num_kv_heads: usize, head_dim: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn fused_output_projection_residual(
&self,
attn_out: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: Option<&Tensor<CpuRuntime>>,
residual: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn fused_output_projection_residual( &self, attn_out: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: Option<&Tensor<CpuRuntime>>, residual: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn fused_qkv_projection_bwd(
&self,
dq: &Tensor<CpuRuntime>,
dk: &Tensor<CpuRuntime>,
dv: &Tensor<CpuRuntime>,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
has_bias: bool,
num_heads: usize,
num_kv_heads: usize,
head_dim: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Option<Tensor<CpuRuntime>>)>
fn fused_qkv_projection_bwd( &self, dq: &Tensor<CpuRuntime>, dk: &Tensor<CpuRuntime>, dv: &Tensor<CpuRuntime>, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, has_bias: bool, num_heads: usize, num_kv_heads: usize, head_dim: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Option<Tensor<CpuRuntime>>)>
Source§fn fused_output_projection_residual_bwd(
&self,
d_output: &Tensor<CpuRuntime>,
attn_out: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
has_bias: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Option<Tensor<CpuRuntime>>, Tensor<CpuRuntime>)>
fn fused_output_projection_residual_bwd( &self, d_output: &Tensor<CpuRuntime>, attn_out: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, has_bias: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Option<Tensor<CpuRuntime>>, Tensor<CpuRuntime>)>
Source§impl FusedQuantOps<CpuRuntime> for CpuClient
impl FusedQuantOps<CpuRuntime> for CpuClient
Source§fn fused_int4_swiglu(
&self,
input: &Tensor<CpuRuntime>,
gate_qweight: &Tensor<CpuRuntime>,
gate_scales: &Tensor<CpuRuntime>,
gate_zeros: &Tensor<CpuRuntime>,
up_qweight: &Tensor<CpuRuntime>,
up_scales: &Tensor<CpuRuntime>,
up_zeros: &Tensor<CpuRuntime>,
group_size: usize,
) -> Result<Tensor<CpuRuntime>>
fn fused_int4_swiglu( &self, input: &Tensor<CpuRuntime>, gate_qweight: &Tensor<CpuRuntime>, gate_scales: &Tensor<CpuRuntime>, gate_zeros: &Tensor<CpuRuntime>, up_qweight: &Tensor<CpuRuntime>, up_scales: &Tensor<CpuRuntime>, up_zeros: &Tensor<CpuRuntime>, group_size: usize, ) -> Result<Tensor<CpuRuntime>>
silu(input @ gate_w) * (input @ up_w) Read moreSource§fn fused_int4_qkv(
&self,
input: &Tensor<CpuRuntime>,
qweight_q: &Tensor<CpuRuntime>,
scales_q: &Tensor<CpuRuntime>,
zeros_q: &Tensor<CpuRuntime>,
qweight_k: &Tensor<CpuRuntime>,
scales_k: &Tensor<CpuRuntime>,
zeros_k: &Tensor<CpuRuntime>,
qweight_v: &Tensor<CpuRuntime>,
scales_v: &Tensor<CpuRuntime>,
zeros_v: &Tensor<CpuRuntime>,
group_size: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn fused_int4_qkv( &self, input: &Tensor<CpuRuntime>, qweight_q: &Tensor<CpuRuntime>, scales_q: &Tensor<CpuRuntime>, zeros_q: &Tensor<CpuRuntime>, qweight_k: &Tensor<CpuRuntime>, scales_k: &Tensor<CpuRuntime>, zeros_k: &Tensor<CpuRuntime>, qweight_v: &Tensor<CpuRuntime>, scales_v: &Tensor<CpuRuntime>, zeros_v: &Tensor<CpuRuntime>, group_size: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
(input@Wq, input@Wk, input@Wv) Read moreSource§impl GemmEpilogueOps<CpuRuntime> for CpuClient
impl GemmEpilogueOps<CpuRuntime> for CpuClient
Source§fn matmul_bias_activation(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
activation: GemmActivation,
) -> Result<Tensor<CpuRuntime>, Error>
fn matmul_bias_activation( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, activation: GemmActivation, ) -> Result<Tensor<CpuRuntime>, Error>
activation(A @ B + bias) Read moreSource§fn matmul_bias_residual(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
residual: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn matmul_bias_residual( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, residual: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
A @ B + bias + residual Read moreSource§fn matmul_bias_activation_bwd(
&self,
grad: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
activation: GemmActivation,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn matmul_bias_activation_bwd( &self, grad: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, activation: GemmActivation, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§impl GrammarDfaOps<CpuRuntime> for CpuClient
impl GrammarDfaOps<CpuRuntime> for CpuClient
Source§fn grammar_dfa_mask_logits(
&self,
logits: &Tensor<CpuRuntime>,
grammar: &DeviceGrammarDfa<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn grammar_dfa_mask_logits( &self, logits: &Tensor<CpuRuntime>, grammar: &DeviceGrammarDfa<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§impl IndexingOps<CpuRuntime> for CpuClient
IndexingOps implementation for CPU runtime.
impl IndexingOps<CpuRuntime> for CpuClient
IndexingOps implementation for CPU runtime.
Source§fn argmax(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn argmax( &self, a: &Tensor<CpuRuntime>, dim: usize, keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn argmin(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn argmin( &self, a: &Tensor<CpuRuntime>, dim: usize, keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gather(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
index: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gather( &self, a: &Tensor<CpuRuntime>, dim: usize, index: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn scatter(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
index: &Tensor<CpuRuntime>,
src: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn scatter( &self, a: &Tensor<CpuRuntime>, dim: usize, index: &Tensor<CpuRuntime>, src: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn index_select(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
index: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn index_select( &self, a: &Tensor<CpuRuntime>, dim: usize, index: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn index_put(
&self,
a: &Tensor<CpuRuntime>,
dim: usize,
index: &Tensor<CpuRuntime>,
src: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn index_put( &self, a: &Tensor<CpuRuntime>, dim: usize, index: &Tensor<CpuRuntime>, src: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn masked_select(
&self,
a: &Tensor<CpuRuntime>,
mask: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn masked_select( &self, a: &Tensor<CpuRuntime>, mask: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn masked_fill(
&self,
a: &Tensor<CpuRuntime>,
mask: &Tensor<CpuRuntime>,
value: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn masked_fill( &self, a: &Tensor<CpuRuntime>, mask: &Tensor<CpuRuntime>, value: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn embedding_lookup(
&self,
embeddings: &Tensor<CpuRuntime>,
indices: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn embedding_lookup( &self, embeddings: &Tensor<CpuRuntime>, indices: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn scatter_reduce(
&self,
dst: &Tensor<CpuRuntime>,
dim: usize,
index: &Tensor<CpuRuntime>,
src: &Tensor<CpuRuntime>,
op: ScatterReduceOp,
include_self: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn scatter_reduce( &self, dst: &Tensor<CpuRuntime>, dim: usize, index: &Tensor<CpuRuntime>, src: &Tensor<CpuRuntime>, op: ScatterReduceOp, include_self: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gather_nd(
&self,
input: &Tensor<CpuRuntime>,
indices: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gather_nd( &self, input: &Tensor<CpuRuntime>, indices: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bincount(
&self,
input: &Tensor<CpuRuntime>,
weights: Option<&Tensor<CpuRuntime>>,
minlength: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn bincount( &self, input: &Tensor<CpuRuntime>, weights: Option<&Tensor<CpuRuntime>>, minlength: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gather_2d(
&self,
input: &Tensor<CpuRuntime>,
rows: &Tensor<CpuRuntime>,
cols: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gather_2d( &self, input: &Tensor<CpuRuntime>, rows: &Tensor<CpuRuntime>, cols: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn slice_assign(
&self,
dst: &Tensor<CpuRuntime>,
src: &Tensor<CpuRuntime>,
dim: usize,
start: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn slice_assign( &self, dst: &Tensor<CpuRuntime>, src: &Tensor<CpuRuntime>, dim: usize, start: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl Kernel<CpuRuntime> for CpuClient
impl Kernel<CpuRuntime> for CpuClient
Source§unsafe fn binary_op<T>(
&self,
op: BinaryOp,
a: *const T,
b: *const T,
out: *mut T,
len: usize,
)where
T: Element,
unsafe fn binary_op<T>(
&self,
op: BinaryOp,
a: *const T,
b: *const T,
out: *mut T,
len: usize,
)where
T: Element,
Source§unsafe fn unary_op<T>(&self, op: UnaryOp, a: *const T, out: *mut T, len: usize)where
T: Element,
unsafe fn unary_op<T>(&self, op: UnaryOp, a: *const T, out: *mut T, len: usize)where
T: Element,
Source§unsafe fn matmul<T>(
&self,
a: *const T,
b: *const T,
out: *mut T,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
)where
T: Element,
unsafe fn matmul<T>(
&self,
a: *const T,
b: *const T,
out: *mut T,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
)where
T: Element,
Source§unsafe fn reduce<T>(
&self,
op: ReduceOp,
a: *const T,
out: *mut T,
reduce_size: usize,
outer_size: usize,
)where
T: Element,
unsafe fn reduce<T>(
&self,
op: ReduceOp,
a: *const T,
out: *mut T,
reduce_size: usize,
outer_size: usize,
)where
T: Element,
Source§impl KvCacheOps<CpuRuntime> for CpuClient
impl KvCacheOps<CpuRuntime> for CpuClient
fn kv_cache_update( &self, k_cache: &Tensor<CpuRuntime>, v_cache: &Tensor<CpuRuntime>, new_k: &Tensor<CpuRuntime>, new_v: &Tensor<CpuRuntime>, position: usize, ) -> Result<()>
Source§fn reshape_and_cache(
&self,
key: &Tensor<CpuRuntime>,
value: &Tensor<CpuRuntime>,
key_cache: &Tensor<CpuRuntime>,
value_cache: &Tensor<CpuRuntime>,
slot_mapping: &Tensor<CpuRuntime>,
block_size: usize,
) -> Result<()>
fn reshape_and_cache( &self, key: &Tensor<CpuRuntime>, value: &Tensor<CpuRuntime>, key_cache: &Tensor<CpuRuntime>, value_cache: &Tensor<CpuRuntime>, slot_mapping: &Tensor<CpuRuntime>, block_size: usize, ) -> Result<()>
Source§impl KvCacheQuantOps<CpuRuntime> for CpuClient
impl KvCacheQuantOps<CpuRuntime> for CpuClient
Source§fn quantize_kv_fp8_per_token(
&self,
input: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn quantize_kv_fp8_per_token( &self, input: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn dequantize_kv_fp8_per_token(
&self,
quantized: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
_output_dtype: DType,
) -> Result<Tensor<CpuRuntime>>
fn dequantize_kv_fp8_per_token( &self, quantized: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, _output_dtype: DType, ) -> Result<Tensor<CpuRuntime>>
Source§fn quantize_kv_int4(
&self,
input: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
group_size: Int4GroupSize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn quantize_kv_int4( &self, input: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, group_size: Int4GroupSize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn dequantize_kv_int4(
&self,
packed: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
zeros: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
group_size: Int4GroupSize,
) -> Result<Tensor<CpuRuntime>>
fn dequantize_kv_int4( &self, packed: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, zeros: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, group_size: Int4GroupSize, ) -> Result<Tensor<CpuRuntime>>
Source§fn quantize_kv_int8(
&self,
input: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn quantize_kv_int8( &self, input: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn dequantize_kv_int8(
&self,
quantized: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
num_tokens: usize,
head_dim: usize,
) -> Result<Tensor<CpuRuntime>>
fn dequantize_kv_int8( &self, quantized: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, num_tokens: usize, head_dim: usize, ) -> Result<Tensor<CpuRuntime>>
Source§impl LinalgOps<CpuRuntime> for CpuClient
LinalgOps implementation for CPU runtime.
impl LinalgOps<CpuRuntime> for CpuClient
LinalgOps implementation for CPU runtime.
Source§fn solve(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn lstsq(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn lstsq( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pinverse(
&self,
a: &Tensor<CpuRuntime>,
rcond: Option<f64>,
) -> Result<Tensor<CpuRuntime>, Error>
fn pinverse( &self, a: &Tensor<CpuRuntime>, rcond: Option<f64>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn matrix_norm(
&self,
a: &Tensor<CpuRuntime>,
ord: MatrixNormOrder,
) -> Result<Tensor<CpuRuntime>, Error>
fn matrix_norm( &self, a: &Tensor<CpuRuntime>, ord: MatrixNormOrder, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn inverse(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn inverse(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn det(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn det(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn trace(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn trace(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn diag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn diag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn diagflat(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn diagflat(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn matrix_rank(
&self,
a: &Tensor<CpuRuntime>,
tol: Option<f64>,
) -> Result<Tensor<CpuRuntime>, Error>
fn matrix_rank( &self, a: &Tensor<CpuRuntime>, tol: Option<f64>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn kron(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn kron( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn solve_banded(
&self,
ab: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
kl: usize,
ku: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve_banded( &self, ab: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, kl: usize, ku: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn khatri_rao(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn khatri_rao( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn triu(
&self,
a: &Tensor<CpuRuntime>,
diagonal: i64,
) -> Result<Tensor<CpuRuntime>, Error>
fn triu( &self, a: &Tensor<CpuRuntime>, diagonal: i64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn tril(
&self,
a: &Tensor<CpuRuntime>,
diagonal: i64,
) -> Result<Tensor<CpuRuntime>, Error>
fn tril( &self, a: &Tensor<CpuRuntime>, diagonal: i64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn slogdet(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<SlogdetResult<CpuRuntime>, Error>
fn slogdet( &self, a: &Tensor<CpuRuntime>, ) -> Result<SlogdetResult<CpuRuntime>, Error>
Source§impl LinearAlgebraAlgorithms<CpuRuntime> for CpuClient
impl LinearAlgebraAlgorithms<CpuRuntime> for CpuClient
Source§fn lu_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<LuDecomposition<CpuRuntime>, Error>
fn lu_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<LuDecomposition<CpuRuntime>, Error>
Source§fn cholesky_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<CholeskyDecomposition<CpuRuntime>, Error>
fn cholesky_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<CholeskyDecomposition<CpuRuntime>, Error>
Source§fn qr_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<QrDecomposition<CpuRuntime>, Error>
fn qr_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<QrDecomposition<CpuRuntime>, Error>
Source§fn qr_decompose_thin(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<QrDecomposition<CpuRuntime>, Error>
fn qr_decompose_thin( &self, a: &Tensor<CpuRuntime>, ) -> Result<QrDecomposition<CpuRuntime>, Error>
[m, k] and R is [k, n]Source§fn solve(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn solve_triangular_lower(
&self,
l: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
unit_diagonal: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve_triangular_lower( &self, l: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, unit_diagonal: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn solve_triangular_upper(
&self,
u: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve_triangular_upper( &self, u: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn lstsq(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn lstsq( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn solve_banded(
&self,
ab: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
kl: usize,
ku: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn solve_banded( &self, ab: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, kl: usize, ku: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn inverse(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn inverse(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn det(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn det(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn trace(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn trace(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn diag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn diag(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn diagflat(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn diagflat(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn kron(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn kron( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn triu(
&self,
a: &Tensor<CpuRuntime>,
diagonal: i64,
) -> Result<Tensor<CpuRuntime>, Error>
fn triu( &self, a: &Tensor<CpuRuntime>, diagonal: i64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn tril(
&self,
a: &Tensor<CpuRuntime>,
diagonal: i64,
) -> Result<Tensor<CpuRuntime>, Error>
fn tril( &self, a: &Tensor<CpuRuntime>, diagonal: i64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn slogdet(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<SlogdetResult<CpuRuntime>, Error>
fn slogdet( &self, a: &Tensor<CpuRuntime>, ) -> Result<SlogdetResult<CpuRuntime>, Error>
Source§fn khatri_rao(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn khatri_rao( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn matrix_rank(
&self,
a: &Tensor<CpuRuntime>,
tol: Option<f64>,
) -> Result<Tensor<CpuRuntime>, Error>
fn matrix_rank( &self, a: &Tensor<CpuRuntime>, tol: Option<f64>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn matrix_norm(
&self,
a: &Tensor<CpuRuntime>,
ord: MatrixNormOrder,
) -> Result<Tensor<CpuRuntime>, Error>
fn matrix_norm( &self, a: &Tensor<CpuRuntime>, ord: MatrixNormOrder, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn svd_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<SvdDecomposition<CpuRuntime>, Error>
fn svd_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<SvdDecomposition<CpuRuntime>, Error>
Source§fn eig_decompose_symmetric(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<EigenDecomposition<CpuRuntime>, Error>
fn eig_decompose_symmetric( &self, a: &Tensor<CpuRuntime>, ) -> Result<EigenDecomposition<CpuRuntime>, Error>
Source§fn pinverse(
&self,
a: &Tensor<CpuRuntime>,
rcond: Option<f64>,
) -> Result<Tensor<CpuRuntime>, Error>
fn pinverse( &self, a: &Tensor<CpuRuntime>, rcond: Option<f64>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cond(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn cond(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cov(
&self,
a: &Tensor<CpuRuntime>,
ddof: Option<usize>,
) -> Result<Tensor<CpuRuntime>, Error>
fn cov( &self, a: &Tensor<CpuRuntime>, ddof: Option<usize>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn corrcoef(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn corrcoef(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn schur_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<SchurDecomposition<CpuRuntime>, Error>
fn schur_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<SchurDecomposition<CpuRuntime>, Error>
Source§fn eig_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<GeneralEigenDecomposition<CpuRuntime>, Error>
fn eig_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<GeneralEigenDecomposition<CpuRuntime>, Error>
Source§fn rsf2csf(
&self,
schur: &SchurDecomposition<CpuRuntime>,
) -> Result<ComplexSchurDecomposition<CpuRuntime>, Error>
fn rsf2csf( &self, schur: &SchurDecomposition<CpuRuntime>, ) -> Result<ComplexSchurDecomposition<CpuRuntime>, Error>
Source§fn qz_decompose(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<GeneralizedSchurDecomposition<CpuRuntime>, Error>
fn qz_decompose( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<GeneralizedSchurDecomposition<CpuRuntime>, Error>
Source§fn polar_decompose(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<PolarDecomposition<CpuRuntime>, Error>
fn polar_decompose( &self, a: &Tensor<CpuRuntime>, ) -> Result<PolarDecomposition<CpuRuntime>, Error>
Source§impl LogicalOps<CpuRuntime> for CpuClient
impl LogicalOps<CpuRuntime> for CpuClient
Source§fn logical_and(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn logical_and( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn logical_or(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn logical_or( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn logical_xor(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn logical_xor( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn logical_not(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn logical_not( &self, a: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl MatmulOps<CpuRuntime> for CpuClient
MatmulOps implementation for CPU runtime.
impl MatmulOps<CpuRuntime> for CpuClient
MatmulOps implementation for CPU runtime.
Source§fn matmul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn matmul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn matmul_bias(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn matmul_bias( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl MatrixFunctionsAlgorithms<CpuRuntime> for CpuClient
impl MatrixFunctionsAlgorithms<CpuRuntime> for CpuClient
Source§fn expm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn expm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn logm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn logm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sqrtm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sqrtm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn signm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn signm(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fractional_matrix_power(
&self,
a: &Tensor<CpuRuntime>,
p: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn fractional_matrix_power( &self, a: &Tensor<CpuRuntime>, p: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl MlaOps<CpuRuntime> for CpuClient
impl MlaOps<CpuRuntime> for CpuClient
fn scaled_dot_product_attention( &self, q: &Var<CpuRuntime>, k: &Var<CpuRuntime>, v: &Var<CpuRuntime>, scale: f64, causal: bool, ) -> Result<Var<CpuRuntime>>
Source§impl MoEOps<CpuRuntime> for CpuClient
impl MoEOps<CpuRuntime> for CpuClient
Source§fn moe_top_k_routing(
&self,
logits: &Tensor<CpuRuntime>,
k: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn moe_top_k_routing( &self, logits: &Tensor<CpuRuntime>, k: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn moe_permute_tokens(
&self,
tokens: &Tensor<CpuRuntime>,
indices: &Tensor<CpuRuntime>,
num_experts: usize,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn moe_permute_tokens( &self, tokens: &Tensor<CpuRuntime>, indices: &Tensor<CpuRuntime>, num_experts: usize, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn moe_unpermute_tokens(
&self,
expert_output: &Tensor<CpuRuntime>,
sort_indices: &Tensor<CpuRuntime>,
weights: &Tensor<CpuRuntime>,
num_tokens: usize,
) -> Result<Tensor<CpuRuntime>>
fn moe_unpermute_tokens( &self, expert_output: &Tensor<CpuRuntime>, sort_indices: &Tensor<CpuRuntime>, weights: &Tensor<CpuRuntime>, num_tokens: usize, ) -> Result<Tensor<CpuRuntime>>
Source§fn moe_grouped_gemm(
&self,
permuted_tokens: &Tensor<CpuRuntime>,
expert_weights: &Tensor<CpuRuntime>,
expert_offsets: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn moe_grouped_gemm( &self, permuted_tokens: &Tensor<CpuRuntime>, expert_weights: &Tensor<CpuRuntime>, expert_offsets: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn moe_grouped_gemm_fused(
&self,
permuted_tokens: &Tensor<CpuRuntime>,
expert_weights: &Tensor<CpuRuntime>,
expert_offsets: &Tensor<CpuRuntime>,
activation: MoEActivation,
) -> Result<Tensor<CpuRuntime>>
fn moe_grouped_gemm_fused( &self, permuted_tokens: &Tensor<CpuRuntime>, expert_weights: &Tensor<CpuRuntime>, expert_offsets: &Tensor<CpuRuntime>, activation: MoEActivation, ) -> Result<Tensor<CpuRuntime>>
Source§impl MultivariateRandomOps<CpuRuntime> for CpuClient
impl MultivariateRandomOps<CpuRuntime> for CpuClient
Source§fn multivariate_normal(
&self,
mean: &Tensor<CpuRuntime>,
cov: &Tensor<CpuRuntime>,
n_samples: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn multivariate_normal( &self, mean: &Tensor<CpuRuntime>, cov: &Tensor<CpuRuntime>, n_samples: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn wishart(
&self,
scale: &Tensor<CpuRuntime>,
df: usize,
n_samples: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn wishart( &self, scale: &Tensor<CpuRuntime>, df: usize, n_samples: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn dirichlet(
&self,
alpha: &Tensor<CpuRuntime>,
n_samples: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn dirichlet( &self, alpha: &Tensor<CpuRuntime>, n_samples: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn multinomial_samples(
&self,
probs: &Tensor<CpuRuntime>,
n_trials: usize,
n_samples: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn multinomial_samples( &self, probs: &Tensor<CpuRuntime>, n_trials: usize, n_samples: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl NormalizationOps<CpuRuntime> for CpuClient
NormalizationOps implementation for CPU runtime.
impl NormalizationOps<CpuRuntime> for CpuClient
NormalizationOps implementation for CPU runtime.
Source§fn rms_norm(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<Tensor<CpuRuntime>, Error>
fn rms_norm( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, eps: f32, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn layer_norm(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<Tensor<CpuRuntime>, Error>
fn layer_norm( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, eps: f32, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn group_norm(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
num_groups: usize,
eps: f32,
) -> Result<Tensor<CpuRuntime>, Error>
fn group_norm( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, num_groups: usize, eps: f32, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fused_add_rms_norm(
&self,
x: &Tensor<CpuRuntime>,
residual: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn fused_add_rms_norm( &self, x: &Tensor<CpuRuntime>, residual: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, eps: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn fused_add_rms_norm_bwd(
&self,
grad: &Tensor<CpuRuntime>,
pre_norm: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn fused_add_rms_norm_bwd( &self, grad: &Tensor<CpuRuntime>, pre_norm: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, eps: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn fused_add_layer_norm(
&self,
x: &Tensor<CpuRuntime>,
residual: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn fused_add_layer_norm( &self, x: &Tensor<CpuRuntime>, residual: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, eps: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn fused_add_layer_norm_bwd(
&self,
grad: &Tensor<CpuRuntime>,
pre_norm: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
bias: &Tensor<CpuRuntime>,
eps: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn fused_add_layer_norm_bwd( &self, grad: &Tensor<CpuRuntime>, pre_norm: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, bias: &Tensor<CpuRuntime>, eps: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§impl PagedAttentionOps<CpuRuntime> for CpuClient
impl PagedAttentionOps<CpuRuntime> for CpuClient
Source§fn paged_attention_fwd(
&self,
q: &Tensor<CpuRuntime>,
k_blocks: &Tensor<CpuRuntime>,
v_blocks: &Tensor<CpuRuntime>,
block_table: &Tensor<CpuRuntime>,
num_heads: usize,
_num_kv_heads: usize,
_seq_len_q: usize,
seq_len_k: usize,
head_dim: usize,
block_size: usize,
causal: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn paged_attention_fwd( &self, q: &Tensor<CpuRuntime>, k_blocks: &Tensor<CpuRuntime>, v_blocks: &Tensor<CpuRuntime>, block_table: &Tensor<CpuRuntime>, num_heads: usize, _num_kv_heads: usize, _seq_len_q: usize, seq_len_k: usize, head_dim: usize, block_size: usize, causal: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn paged_attention_fwd_fp8(
&self,
_q: &Tensor<CpuRuntime>,
_k_blocks: &Tensor<CpuRuntime>,
_v_blocks: &Tensor<CpuRuntime>,
_block_table: &Tensor<CpuRuntime>,
_num_heads: usize,
_num_kv_heads: usize,
_seq_len_q: usize,
_seq_len_k: usize,
_head_dim: usize,
_block_size: usize,
_causal: bool,
_q_scale: f32,
_k_scale: f32,
_v_scale: f32,
_o_scale: f32,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn paged_attention_fwd_fp8( &self, _q: &Tensor<CpuRuntime>, _k_blocks: &Tensor<CpuRuntime>, _v_blocks: &Tensor<CpuRuntime>, _block_table: &Tensor<CpuRuntime>, _num_heads: usize, _num_kv_heads: usize, _seq_len_q: usize, _seq_len_k: usize, _head_dim: usize, _block_size: usize, _causal: bool, _q_scale: f32, _k_scale: f32, _v_scale: f32, _o_scale: f32, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn paged_attention_bwd(
&self,
dout: &Tensor<CpuRuntime>,
q: &Tensor<CpuRuntime>,
k_blocks: &Tensor<CpuRuntime>,
v_blocks: &Tensor<CpuRuntime>,
output: &Tensor<CpuRuntime>,
lse: &Tensor<CpuRuntime>,
block_table: &Tensor<CpuRuntime>,
num_heads: usize,
_num_kv_heads: usize,
_seq_len_q: usize,
seq_len_k: usize,
head_dim: usize,
block_size: usize,
causal: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn paged_attention_bwd( &self, dout: &Tensor<CpuRuntime>, q: &Tensor<CpuRuntime>, k_blocks: &Tensor<CpuRuntime>, v_blocks: &Tensor<CpuRuntime>, output: &Tensor<CpuRuntime>, lse: &Tensor<CpuRuntime>, block_table: &Tensor<CpuRuntime>, num_heads: usize, _num_kv_heads: usize, _seq_len_q: usize, seq_len_k: usize, head_dim: usize, block_size: usize, causal: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§impl PolynomialAlgorithms<CpuRuntime> for CpuClient
impl PolynomialAlgorithms<CpuRuntime> for CpuClient
Source§fn polyroots(
&self,
coeffs: &Tensor<CpuRuntime>,
) -> Result<PolynomialRoots<CpuRuntime>, Error>
fn polyroots( &self, coeffs: &Tensor<CpuRuntime>, ) -> Result<PolynomialRoots<CpuRuntime>, Error>
Source§fn polyval(
&self,
coeffs: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn polyval( &self, coeffs: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn polyfromroots(
&self,
roots_real: &Tensor<CpuRuntime>,
roots_imag: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn polyfromroots( &self, roots_real: &Tensor<CpuRuntime>, roots_imag: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn polymul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn polymul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl QuantMatmulOps<CpuRuntime> for CpuClient
impl QuantMatmulOps<CpuRuntime> for CpuClient
Source§fn int4_gemm(
&self,
input: &Tensor<CpuRuntime>,
qweight: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
zeros: &Tensor<CpuRuntime>,
group_size: usize,
) -> Result<Tensor<CpuRuntime>>
fn int4_gemm( &self, input: &Tensor<CpuRuntime>, qweight: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, zeros: &Tensor<CpuRuntime>, group_size: usize, ) -> Result<Tensor<CpuRuntime>>
Source§fn int4_gemm_gptq(
&self,
input: &Tensor<CpuRuntime>,
qweight: &Tensor<CpuRuntime>,
qzeros: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
g_idx: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn int4_gemm_gptq( &self, input: &Tensor<CpuRuntime>, qweight: &Tensor<CpuRuntime>, qzeros: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, g_idx: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn marlin_gemm(
&self,
input: &Tensor<CpuRuntime>,
weight: &Tensor<CpuRuntime>,
scales: &Tensor<CpuRuntime>,
zeros: &Tensor<CpuRuntime>,
group_size: usize,
) -> Result<Tensor<CpuRuntime>>
fn marlin_gemm( &self, input: &Tensor<CpuRuntime>, weight: &Tensor<CpuRuntime>, scales: &Tensor<CpuRuntime>, zeros: &Tensor<CpuRuntime>, group_size: usize, ) -> Result<Tensor<CpuRuntime>>
Source§fn quant_matmul_batch(
&self,
activation: &Tensor<CpuRuntime>,
weights: &[&QuantTensor<CpuRuntime>],
) -> Result<Vec<Tensor<CpuRuntime>>>
fn quant_matmul_batch( &self, activation: &Tensor<CpuRuntime>, weights: &[&QuantTensor<CpuRuntime>], ) -> Result<Vec<Tensor<CpuRuntime>>>
fn quant_matmul( &self, activation: &Tensor<CpuRuntime>, weight: &QuantTensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn quant_swiglu(
&self,
activation: &Tensor<CpuRuntime>,
gate_weight: &QuantTensor<CpuRuntime>,
up_weight: &QuantTensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn quant_swiglu( &self, activation: &Tensor<CpuRuntime>, gate_weight: &QuantTensor<CpuRuntime>, up_weight: &QuantTensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
silu(activation × gate_weight) * (activation × up_weight) Read moreSource§impl QuasiRandomOps<CpuRuntime> for CpuClient
impl QuasiRandomOps<CpuRuntime> for CpuClient
Source§fn sobol(
&self,
n_points: usize,
dimension: usize,
skip: usize,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn sobol( &self, n_points: usize, dimension: usize, skip: usize, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl RandomOps<CpuRuntime> for CpuClient
RandomOps implementation for CPU runtime.
impl RandomOps<CpuRuntime> for CpuClient
RandomOps implementation for CPU runtime.
Source§fn rand(
&self,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn rand( &self, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn rand_seeded(
&self,
shape: &[usize],
dtype: DType,
seed: u64,
) -> Result<Tensor<CpuRuntime>, Error>
fn rand_seeded( &self, shape: &[usize], dtype: DType, seed: u64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn randn(
&self,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn randn( &self, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn randint(
&self,
low: i64,
high: i64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn randint( &self, low: i64, high: i64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn multinomial(
&self,
probs: &Tensor<CpuRuntime>,
num_samples: usize,
replacement: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn multinomial( &self, probs: &Tensor<CpuRuntime>, num_samples: usize, replacement: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bernoulli(
&self,
p: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn bernoulli( &self, p: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn beta(
&self,
alpha: f64,
beta: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn beta( &self, alpha: f64, beta: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gamma(
&self,
shape_param: f64,
scale: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn gamma( &self, shape_param: f64, scale: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn exponential(
&self,
rate: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn exponential( &self, rate: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn poisson(
&self,
lambda: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn poisson( &self, lambda: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn binomial(
&self,
n: u64,
p: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn binomial( &self, n: u64, p: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn laplace(
&self,
loc: f64,
scale: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn laplace( &self, loc: f64, scale: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn chi_squared(
&self,
df: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn chi_squared( &self, df: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn student_t(
&self,
df: f64,
shape: &[usize],
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn student_t( &self, df: f64, shape: &[usize], dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl ReduceOps<CpuRuntime> for CpuClient
ReduceOps implementation for CPU runtime.
impl ReduceOps<CpuRuntime> for CpuClient
ReduceOps implementation for CPU runtime.
Source§fn sum(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn sum( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sum_with_precision(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
precision: AccumulationPrecision,
) -> Result<Tensor<CpuRuntime>, Error>
fn sum_with_precision( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, precision: AccumulationPrecision, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn mean(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn mean( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn max(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn max( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn max_with_precision(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
precision: AccumulationPrecision,
) -> Result<Tensor<CpuRuntime>, Error>
fn max_with_precision( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, precision: AccumulationPrecision, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn min(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn min( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn min_with_precision(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
precision: AccumulationPrecision,
) -> Result<Tensor<CpuRuntime>, Error>
fn min_with_precision( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, precision: AccumulationPrecision, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn prod(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn prod( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn prod_with_precision(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
precision: AccumulationPrecision,
) -> Result<Tensor<CpuRuntime>, Error>
fn prod_with_precision( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, precision: AccumulationPrecision, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl RoPEOps<CpuRuntime> for CpuClient
impl RoPEOps<CpuRuntime> for CpuClient
Source§fn apply_rope(
&self,
x: &Var<CpuRuntime>,
cos_cache: &Var<CpuRuntime>,
sin_cache: &Var<CpuRuntime>,
) -> Result<Var<CpuRuntime>>
fn apply_rope( &self, x: &Var<CpuRuntime>, cos_cache: &Var<CpuRuntime>, sin_cache: &Var<CpuRuntime>, ) -> Result<Var<CpuRuntime>>
(x[..., d], x[..., d+D/2]).
Used by LLaMA, Mistral, and most modern LLMs.Source§fn apply_rope_interleaved(
&self,
x: &Var<CpuRuntime>,
cos_cache: &Var<CpuRuntime>,
sin_cache: &Var<CpuRuntime>,
) -> Result<Var<CpuRuntime>>
fn apply_rope_interleaved( &self, x: &Var<CpuRuntime>, cos_cache: &Var<CpuRuntime>, sin_cache: &Var<CpuRuntime>, ) -> Result<Var<CpuRuntime>>
(x[..., 2d], x[..., 2d+1]).
Used by GPT-NeoX, Qwen, RoFormer — the “mathematically pure” form
treating adjacent elements as complex number (real + imaginary). Read moreSource§fn apply_rope_yarn(
&self,
x: &Var<CpuRuntime>,
cos_cache: &Var<CpuRuntime>,
sin_cache: &Var<CpuRuntime>,
attn_scale: f32,
) -> Result<Var<CpuRuntime>>
fn apply_rope_yarn( &self, x: &Var<CpuRuntime>, cos_cache: &Var<CpuRuntime>, sin_cache: &Var<CpuRuntime>, attn_scale: f32, ) -> Result<Var<CpuRuntime>>
Source§impl Runtime for CpuRuntime
impl Runtime for CpuRuntime
Source§fn capture_graph<F, T>(
client: &<CpuRuntime as Runtime>::Client,
f: F,
) -> Result<(<CpuRuntime as Runtime>::Graph, T), Error>
fn capture_graph<F, T>( client: &<CpuRuntime as Runtime>::Client, f: F, ) -> Result<(<CpuRuntime as Runtime>::Graph, T), Error>
Source§fn allocate(
size_bytes: usize,
_device: &<CpuRuntime as Runtime>::Device,
) -> Result<u64, Error>
fn allocate( size_bytes: usize, _device: &<CpuRuntime as Runtime>::Device, ) -> Result<u64, Error>
Source§fn deallocate(
ptr: u64,
size_bytes: usize,
_device: &<CpuRuntime as Runtime>::Device,
)
fn deallocate( ptr: u64, size_bytes: usize, _device: &<CpuRuntime as Runtime>::Device, )
Source§fn copy_to_device(
src: &[u8],
dst: u64,
_device: &<CpuRuntime as Runtime>::Device,
) -> Result<(), Error>
fn copy_to_device( src: &[u8], dst: u64, _device: &<CpuRuntime as Runtime>::Device, ) -> Result<(), Error>
Source§fn copy_from_device(
src: u64,
dst: &mut [u8],
_device: &<CpuRuntime as Runtime>::Device,
) -> Result<(), Error>
fn copy_from_device( src: u64, dst: &mut [u8], _device: &<CpuRuntime as Runtime>::Device, ) -> Result<(), Error>
Source§fn copy_within_device(
src: u64,
dst: u64,
size_bytes: usize,
_device: &<CpuRuntime as Runtime>::Device,
) -> Result<(), Error>
fn copy_within_device( src: u64, dst: u64, size_bytes: usize, _device: &<CpuRuntime as Runtime>::Device, ) -> Result<(), Error>
Source§fn copy_strided(
src_handle: u64,
src_byte_offset: usize,
dst_handle: u64,
shape: &[usize],
strides: &[isize],
elem_size: usize,
_device: &<CpuRuntime as Runtime>::Device,
) -> Result<(), Error>
fn copy_strided( src_handle: u64, src_byte_offset: usize, dst_handle: u64, shape: &[usize], strides: &[isize], elem_size: usize, _device: &<CpuRuntime as Runtime>::Device, ) -> Result<(), Error>
Source§fn default_device() -> <CpuRuntime as Runtime>::Device
fn default_device() -> <CpuRuntime as Runtime>::Device
Source§fn default_client(
device: &<CpuRuntime as Runtime>::Device,
) -> <CpuRuntime as Runtime>::Client
fn default_client( device: &<CpuRuntime as Runtime>::Device, ) -> <CpuRuntime as Runtime>::Client
Source§fn raw_handle(
_client: &<CpuRuntime as Runtime>::Client,
) -> &<CpuRuntime as Runtime>::RawHandle
fn raw_handle( _client: &<CpuRuntime as Runtime>::Client, ) -> &<CpuRuntime as Runtime>::RawHandle
Source§fn supports_graph_capture() -> bool
fn supports_graph_capture() -> bool
Source§impl RuntimeClient<CpuRuntime> for CpuClient
impl RuntimeClient<CpuRuntime> for CpuClient
Source§fn synchronize(&self)
fn synchronize(&self)
Source§impl SamplingOps<CpuRuntime> for CpuClient
impl SamplingOps<CpuRuntime> for CpuClient
Source§fn apply_sampling_penalties(
&self,
logits: &Tensor<CpuRuntime>,
token_ids: &Tensor<CpuRuntime>,
token_counts: &Tensor<CpuRuntime>,
repeat_penalty: f32,
frequency_penalty: f32,
presence_penalty: f32,
) -> Result<()>
fn apply_sampling_penalties( &self, logits: &Tensor<CpuRuntime>, token_ids: &Tensor<CpuRuntime>, token_counts: &Tensor<CpuRuntime>, repeat_penalty: f32, frequency_penalty: f32, presence_penalty: f32, ) -> Result<()>
Source§fn sample_token(
&self,
logits: &Tensor<CpuRuntime>,
temperature: f32,
top_k: usize,
top_p: f32,
min_p: f32,
) -> Result<u32>
fn sample_token( &self, logits: &Tensor<CpuRuntime>, temperature: f32, top_k: usize, top_p: f32, min_p: f32, ) -> Result<u32>
Source§fn logits_to_token(
&self,
logits: &Tensor<CpuRuntime>,
token_ids: &Tensor<CpuRuntime>,
token_counts: &Tensor<CpuRuntime>,
num_unique: usize,
repeat_penalty: f32,
frequency_penalty: f32,
presence_penalty: f32,
temperature: f32,
top_k: usize,
top_p: f32,
min_p: f32,
seed: Option<u64>,
) -> Result<Tensor<CpuRuntime>>
fn logits_to_token( &self, logits: &Tensor<CpuRuntime>, token_ids: &Tensor<CpuRuntime>, token_counts: &Tensor<CpuRuntime>, num_unique: usize, repeat_penalty: f32, frequency_penalty: f32, presence_penalty: f32, temperature: f32, top_k: usize, top_p: f32, min_p: f32, seed: Option<u64>, ) -> Result<Tensor<CpuRuntime>>
Source§impl ScalarOps<CpuRuntime> for CpuClient
impl ScalarOps<CpuRuntime> for CpuClient
Source§fn add_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn add_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sub_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn sub_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn mul_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn mul_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn div_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn div_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pow_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn pow_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn rsub_scalar(
&self,
a: &Tensor<CpuRuntime>,
scalar: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn rsub_scalar( &self, a: &Tensor<CpuRuntime>, scalar: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fused_mul_add_scalar(
&self,
a: &Tensor<CpuRuntime>,
scale: f64,
bias: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn fused_mul_add_scalar( &self, a: &Tensor<CpuRuntime>, scale: f64, bias: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl SemiringMatmulOps<CpuRuntime> for CpuClient
impl SemiringMatmulOps<CpuRuntime> for CpuClient
Source§fn semiring_matmul(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
op: SemiringOp,
) -> Result<Tensor<CpuRuntime>, Error>
fn semiring_matmul( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, op: SemiringOp, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl ShapeOps<CpuRuntime> for CpuClient
ShapeOps implementation for CPU runtime.
impl ShapeOps<CpuRuntime> for CpuClient
ShapeOps implementation for CPU runtime.
Source§fn cat(
&self,
tensors: &[&Tensor<CpuRuntime>],
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn cat( &self, tensors: &[&Tensor<CpuRuntime>], dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn stack(
&self,
tensors: &[&Tensor<CpuRuntime>],
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn stack( &self, tensors: &[&Tensor<CpuRuntime>], dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn split(
&self,
tensor: &Tensor<CpuRuntime>,
split_size: usize,
dim: isize,
) -> Result<Vec<Tensor<CpuRuntime>>, Error>
fn split( &self, tensor: &Tensor<CpuRuntime>, split_size: usize, dim: isize, ) -> Result<Vec<Tensor<CpuRuntime>>, Error>
Source§fn chunk(
&self,
tensor: &Tensor<CpuRuntime>,
chunks: usize,
dim: isize,
) -> Result<Vec<Tensor<CpuRuntime>>, Error>
fn chunk( &self, tensor: &Tensor<CpuRuntime>, chunks: usize, dim: isize, ) -> Result<Vec<Tensor<CpuRuntime>>, Error>
Source§fn repeat(
&self,
tensor: &Tensor<CpuRuntime>,
repeats: &[usize],
) -> Result<Tensor<CpuRuntime>, Error>
fn repeat( &self, tensor: &Tensor<CpuRuntime>, repeats: &[usize], ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn pad(
&self,
tensor: &Tensor<CpuRuntime>,
padding: &[usize],
value: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn pad( &self, tensor: &Tensor<CpuRuntime>, padding: &[usize], value: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn roll(
&self,
tensor: &Tensor<CpuRuntime>,
shift: isize,
dim: isize,
) -> Result<Tensor<CpuRuntime>, Error>
fn roll( &self, tensor: &Tensor<CpuRuntime>, shift: isize, dim: isize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn unfold(
&self,
tensor: &Tensor<CpuRuntime>,
dim: isize,
size: usize,
step: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn unfold( &self, tensor: &Tensor<CpuRuntime>, dim: isize, size: usize, step: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn repeat_interleave(
&self,
tensor: &Tensor<CpuRuntime>,
repeats: usize,
dim: Option<isize>,
) -> Result<Tensor<CpuRuntime>, Error>
fn repeat_interleave( &self, tensor: &Tensor<CpuRuntime>, repeats: usize, dim: Option<isize>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl SortingOps<CpuRuntime> for CpuClient
SortingOps implementation for CPU runtime.
impl SortingOps<CpuRuntime> for CpuClient
SortingOps implementation for CPU runtime.
Source§fn sort(
&self,
a: &Tensor<CpuRuntime>,
dim: isize,
descending: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn sort( &self, a: &Tensor<CpuRuntime>, dim: isize, descending: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sort_with_indices(
&self,
a: &Tensor<CpuRuntime>,
dim: isize,
descending: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn sort_with_indices( &self, a: &Tensor<CpuRuntime>, dim: isize, descending: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn argsort(
&self,
a: &Tensor<CpuRuntime>,
dim: isize,
descending: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn argsort( &self, a: &Tensor<CpuRuntime>, dim: isize, descending: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn topk(
&self,
a: &Tensor<CpuRuntime>,
k: usize,
dim: isize,
largest: bool,
sorted: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn topk( &self, a: &Tensor<CpuRuntime>, k: usize, dim: isize, largest: bool, sorted: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn unique(
&self,
a: &Tensor<CpuRuntime>,
sorted: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn unique( &self, a: &Tensor<CpuRuntime>, sorted: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn unique_with_counts(
&self,
a: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn unique_with_counts( &self, a: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn nonzero(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn nonzero(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn searchsorted(
&self,
sorted_sequence: &Tensor<CpuRuntime>,
values: &Tensor<CpuRuntime>,
right: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn searchsorted( &self, sorted_sequence: &Tensor<CpuRuntime>, values: &Tensor<CpuRuntime>, right: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl SpecialFunctions<CpuRuntime> for CpuClient
impl SpecialFunctions<CpuRuntime> for CpuClient
Source§fn erf(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn erf(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn erfc(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn erfc(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn erfinv(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn erfinv(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn gamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn lgamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn lgamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn digamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn digamma(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn beta(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn beta( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn betainc(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn betainc( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gammainc(
&self,
a: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gammainc( &self, a: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gammaincc(
&self,
a: &Tensor<CpuRuntime>,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gammaincc( &self, a: &Tensor<CpuRuntime>, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn gammaincinv(
&self,
a: &Tensor<CpuRuntime>,
p: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn gammaincinv( &self, a: &Tensor<CpuRuntime>, p: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn betaincinv(
&self,
a: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
p: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn betaincinv( &self, a: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, p: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_j0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_j0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_j1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_j1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_y0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_y0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_y1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_y1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_i0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_i0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_i1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_i1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_k0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_k0(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn bessel_k1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn bessel_k1(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ellipk(&self, m: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn ellipk(&self, m: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ellipe(&self, m: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn ellipe(&self, m: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn hyp2f1(
&self,
a: f64,
b: f64,
c: f64,
z: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn hyp2f1( &self, a: f64, b: f64, c: f64, z: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn hyp1f1(
&self,
a: f64,
b: f64,
z: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn hyp1f1( &self, a: f64, b: f64, z: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn airy_ai(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn airy_ai(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn airy_bi(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn airy_bi(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn legendre_p(
&self,
n: i32,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn legendre_p( &self, n: i32, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn legendre_p_assoc(
&self,
n: i32,
m: i32,
x: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn legendre_p_assoc( &self, n: i32, m: i32, x: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sph_harm(
&self,
n: i32,
m: i32,
theta: &Tensor<CpuRuntime>,
phi: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn sph_harm( &self, n: i32, m: i32, theta: &Tensor<CpuRuntime>, phi: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fresnel_s(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn fresnel_s(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fresnel_c(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn fresnel_c(&self, x: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§impl SpeculativeOps<CpuRuntime> for CpuClient
impl SpeculativeOps<CpuRuntime> for CpuClient
Source§fn verify_speculative_tokens(
&self,
draft_probs: &Tensor<CpuRuntime>,
target_probs: &Tensor<CpuRuntime>,
draft_tokens: &Tensor<CpuRuntime>,
seed: u64,
) -> Result<Vec<VerificationResult>>
fn verify_speculative_tokens( &self, draft_probs: &Tensor<CpuRuntime>, target_probs: &Tensor<CpuRuntime>, draft_tokens: &Tensor<CpuRuntime>, seed: u64, ) -> Result<Vec<VerificationResult>>
Source§fn compute_acceptance_probs(
&self,
draft_probs: &Tensor<CpuRuntime>,
target_probs: &Tensor<CpuRuntime>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn compute_acceptance_probs( &self, draft_probs: &Tensor<CpuRuntime>, target_probs: &Tensor<CpuRuntime>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn compute_expected_tokens(
&self,
acceptance_rates: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn compute_expected_tokens( &self, acceptance_rates: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§impl SsmKernelOps<CpuRuntime> for CpuClient
impl SsmKernelOps<CpuRuntime> for CpuClient
Source§fn ssd_chunk_cumsum(
&self,
dt: &Tensor<CpuRuntime>,
a: &Tensor<CpuRuntime>,
dt_bias: Option<&Tensor<CpuRuntime>>,
chunk_size: usize,
dt_softplus: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn ssd_chunk_cumsum( &self, dt: &Tensor<CpuRuntime>, a: &Tensor<CpuRuntime>, dt_bias: Option<&Tensor<CpuRuntime>>, chunk_size: usize, dt_softplus: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn ssd_chunk_state(
&self,
x: &Tensor<CpuRuntime>,
b: &Tensor<CpuRuntime>,
dt: &Tensor<CpuRuntime>,
dA_cumsum: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn ssd_chunk_state( &self, x: &Tensor<CpuRuntime>, b: &Tensor<CpuRuntime>, dt: &Tensor<CpuRuntime>, dA_cumsum: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn ssd_state_passing(
&self,
states: &Tensor<CpuRuntime>,
dA_cumsum: &Tensor<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>>
fn ssd_state_passing( &self, states: &Tensor<CpuRuntime>, dA_cumsum: &Tensor<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>>
Source§fn ssd_chunk_scan(
&self,
x: &Tensor<CpuRuntime>,
states: &Tensor<CpuRuntime>,
c: &Tensor<CpuRuntime>,
dA_cumsum: &Tensor<CpuRuntime>,
d: Option<&Tensor<CpuRuntime>>,
) -> Result<Tensor<CpuRuntime>>
fn ssd_chunk_scan( &self, x: &Tensor<CpuRuntime>, states: &Tensor<CpuRuntime>, c: &Tensor<CpuRuntime>, dA_cumsum: &Tensor<CpuRuntime>, d: Option<&Tensor<CpuRuntime>>, ) -> Result<Tensor<CpuRuntime>>
Source§impl StatisticalOps<CpuRuntime> for CpuClient
StatisticalOps implementation for CPU runtime.
impl StatisticalOps<CpuRuntime> for CpuClient
StatisticalOps implementation for CPU runtime.
Source§fn var(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
correction: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn var( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, correction: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn std(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
correction: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn std( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, correction: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn quantile(
&self,
a: &Tensor<CpuRuntime>,
q: f64,
dim: Option<isize>,
keepdim: bool,
interpolation: &str,
) -> Result<Tensor<CpuRuntime>, Error>
fn quantile( &self, a: &Tensor<CpuRuntime>, q: f64, dim: Option<isize>, keepdim: bool, interpolation: &str, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn percentile(
&self,
a: &Tensor<CpuRuntime>,
p: f64,
dim: Option<isize>,
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn percentile( &self, a: &Tensor<CpuRuntime>, p: f64, dim: Option<isize>, keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn median(
&self,
a: &Tensor<CpuRuntime>,
dim: Option<isize>,
keepdim: bool,
) -> Result<Tensor<CpuRuntime>, Error>
fn median( &self, a: &Tensor<CpuRuntime>, dim: Option<isize>, keepdim: bool, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn histogram(
&self,
a: &Tensor<CpuRuntime>,
bins: usize,
range: Option<(f64, f64)>,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn histogram( &self, a: &Tensor<CpuRuntime>, bins: usize, range: Option<(f64, f64)>, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§fn cov(
&self,
a: &Tensor<CpuRuntime>,
ddof: Option<usize>,
) -> Result<Tensor<CpuRuntime>, Error>
fn cov( &self, a: &Tensor<CpuRuntime>, ddof: Option<usize>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn corrcoef(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn corrcoef(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn skew(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
correction: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn skew( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, correction: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn kurtosis(
&self,
a: &Tensor<CpuRuntime>,
dims: &[usize],
keepdim: bool,
correction: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn kurtosis( &self, a: &Tensor<CpuRuntime>, dims: &[usize], keepdim: bool, correction: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn mode(
&self,
a: &Tensor<CpuRuntime>,
dim: Option<isize>,
keepdim: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
fn mode( &self, a: &Tensor<CpuRuntime>, dim: Option<isize>, keepdim: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>), Error>
Source§impl TensorDecomposeAlgorithms<CpuRuntime> for CpuClient
impl TensorDecomposeAlgorithms<CpuRuntime> for CpuClient
Source§fn unfold(
&self,
tensor: &Tensor<CpuRuntime>,
mode: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn unfold( &self, tensor: &Tensor<CpuRuntime>, mode: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fold(
&self,
matrix: &Tensor<CpuRuntime>,
mode: usize,
shape: &[usize],
) -> Result<Tensor<CpuRuntime>, Error>
fn fold( &self, matrix: &Tensor<CpuRuntime>, mode: usize, shape: &[usize], ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn mode_n_product(
&self,
tensor: &Tensor<CpuRuntime>,
matrix: &Tensor<CpuRuntime>,
mode: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn mode_n_product( &self, tensor: &Tensor<CpuRuntime>, matrix: &Tensor<CpuRuntime>, mode: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn hosvd(
&self,
tensor: &Tensor<CpuRuntime>,
ranks: &[usize],
) -> Result<TuckerDecomposition<CpuRuntime>, Error>
fn hosvd( &self, tensor: &Tensor<CpuRuntime>, ranks: &[usize], ) -> Result<TuckerDecomposition<CpuRuntime>, Error>
Source§fn tucker(
&self,
tensor: &Tensor<CpuRuntime>,
ranks: &[usize],
options: TuckerOptions,
) -> Result<TuckerDecomposition<CpuRuntime>, Error>
fn tucker( &self, tensor: &Tensor<CpuRuntime>, ranks: &[usize], options: TuckerOptions, ) -> Result<TuckerDecomposition<CpuRuntime>, Error>
Source§fn cp_decompose(
&self,
tensor: &Tensor<CpuRuntime>,
rank: usize,
options: CpOptions,
) -> Result<CpDecomposition<CpuRuntime>, Error>
fn cp_decompose( &self, tensor: &Tensor<CpuRuntime>, rank: usize, options: CpOptions, ) -> Result<CpDecomposition<CpuRuntime>, Error>
Source§fn tensor_train(
&self,
tensor: &Tensor<CpuRuntime>,
max_rank: usize,
tolerance: f64,
) -> Result<TensorTrainDecomposition<CpuRuntime>, Error>
fn tensor_train( &self, tensor: &Tensor<CpuRuntime>, max_rank: usize, tolerance: f64, ) -> Result<TensorTrainDecomposition<CpuRuntime>, Error>
Source§fn tucker_reconstruct(
&self,
decomp: &TuckerDecomposition<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn tucker_reconstruct( &self, decomp: &TuckerDecomposition<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cp_reconstruct(
&self,
decomp: &CpDecomposition<CpuRuntime>,
shape: &[usize],
) -> Result<Tensor<CpuRuntime>, Error>
fn cp_reconstruct( &self, decomp: &CpDecomposition<CpuRuntime>, shape: &[usize], ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn tt_reconstruct(
&self,
decomp: &TensorTrainDecomposition<CpuRuntime>,
) -> Result<Tensor<CpuRuntime>, Error>
fn tt_reconstruct( &self, decomp: &TensorTrainDecomposition<CpuRuntime>, ) -> Result<Tensor<CpuRuntime>, Error>
Source§impl TypeConversionOps<CpuRuntime> for CpuClient
TypeConversionOps implementation for CPU runtime.
impl TypeConversionOps<CpuRuntime> for CpuClient
TypeConversionOps implementation for CPU runtime.
Source§impl UnaryOps<CpuRuntime> for CpuClient
UnaryOps implementation for CPU runtime.
impl UnaryOps<CpuRuntime> for CpuClient
UnaryOps implementation for CPU runtime.
Source§fn neg(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn neg(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn abs(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn abs(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sqrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sqrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn exp(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn exp(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn log(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn log(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sin(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sin(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cos(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn cos(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn tanh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn tanh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn tan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn tan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn asin(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn asin(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn acos(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn acos(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn atan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn atan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sinh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sinh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cosh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn cosh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn asinh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn asinh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn acosh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn acosh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn atanh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn atanh(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn recip(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn recip(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn rsqrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn rsqrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn square(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn square(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn cbrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn cbrt(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn exp2(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn exp2(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn expm1(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn expm1(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn log2(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn log2(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn log10(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn log10(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn log1p(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn log1p(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn floor(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn floor(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn ceil(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn ceil(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn round(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn round(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn trunc(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn trunc(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn sign(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn sign(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn isnan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn isnan(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§fn isinf(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
fn isinf(&self, a: &Tensor<CpuRuntime>) -> Result<Tensor<CpuRuntime>, Error>
Source§impl UtilityOps<CpuRuntime> for CpuClient
UtilityOps implementation for CPU runtime.
impl UtilityOps<CpuRuntime> for CpuClient
UtilityOps implementation for CPU runtime.
Source§fn clamp(
&self,
a: &Tensor<CpuRuntime>,
min_val: f64,
max_val: f64,
) -> Result<Tensor<CpuRuntime>, Error>
fn clamp( &self, a: &Tensor<CpuRuntime>, min_val: f64, max_val: f64, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn fill(
&self,
shape: &[usize],
value: f64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn fill( &self, shape: &[usize], value: f64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn arange(
&self,
start: f64,
stop: f64,
step: f64,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn arange( &self, start: f64, stop: f64, step: f64, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn linspace(
&self,
start: f64,
stop: f64,
steps: usize,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn linspace( &self, start: f64, stop: f64, steps: usize, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn eye(
&self,
n: usize,
m: Option<usize>,
dtype: DType,
) -> Result<Tensor<CpuRuntime>, Error>
fn eye( &self, n: usize, m: Option<usize>, dtype: DType, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn one_hot(
&self,
indices: &Tensor<CpuRuntime>,
num_classes: usize,
) -> Result<Tensor<CpuRuntime>, Error>
fn one_hot( &self, indices: &Tensor<CpuRuntime>, num_classes: usize, ) -> Result<Tensor<CpuRuntime>, Error>
Source§fn meshgrid(
&self,
tensors: &[&Tensor<CpuRuntime>],
indexing: MeshgridIndexing,
) -> Result<Vec<Tensor<CpuRuntime>>, Error>
fn meshgrid( &self, tensors: &[&Tensor<CpuRuntime>], indexing: MeshgridIndexing, ) -> Result<Vec<Tensor<CpuRuntime>>, Error>
Source§impl VarLenAttentionOps<CpuRuntime> for CpuClient
impl VarLenAttentionOps<CpuRuntime> for CpuClient
Source§fn varlen_attention_fwd(
&self,
q: &Tensor<CpuRuntime>,
k: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
cu_seqlens_q: &Tensor<CpuRuntime>,
cu_seqlens_k: &Tensor<CpuRuntime>,
batch_size: usize,
num_heads: usize,
_max_seqlen_q: usize,
_max_seqlen_k: usize,
head_dim: usize,
causal: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn varlen_attention_fwd( &self, q: &Tensor<CpuRuntime>, k: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, cu_seqlens_q: &Tensor<CpuRuntime>, cu_seqlens_k: &Tensor<CpuRuntime>, batch_size: usize, num_heads: usize, _max_seqlen_q: usize, _max_seqlen_k: usize, head_dim: usize, causal: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
Source§fn varlen_attention_bwd(
&self,
dout: &Tensor<CpuRuntime>,
q: &Tensor<CpuRuntime>,
k: &Tensor<CpuRuntime>,
v: &Tensor<CpuRuntime>,
output: &Tensor<CpuRuntime>,
lse: &Tensor<CpuRuntime>,
cu_seqlens_q: &Tensor<CpuRuntime>,
cu_seqlens_k: &Tensor<CpuRuntime>,
batch_size: usize,
num_heads: usize,
_max_seqlen_q: usize,
_max_seqlen_k: usize,
head_dim: usize,
causal: bool,
) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
fn varlen_attention_bwd( &self, dout: &Tensor<CpuRuntime>, q: &Tensor<CpuRuntime>, k: &Tensor<CpuRuntime>, v: &Tensor<CpuRuntime>, output: &Tensor<CpuRuntime>, lse: &Tensor<CpuRuntime>, cu_seqlens_q: &Tensor<CpuRuntime>, cu_seqlens_k: &Tensor<CpuRuntime>, batch_size: usize, num_heads: usize, _max_seqlen_q: usize, _max_seqlen_k: usize, head_dim: usize, causal: bool, ) -> Result<(Tensor<CpuRuntime>, Tensor<CpuRuntime>, Tensor<CpuRuntime>)>
impl TensorOps<CpuRuntime> for CpuClient
Auto Trait Implementations§
impl Freeze for CpuRuntime
impl RefUnwindSafe for CpuRuntime
impl Send for CpuRuntime
impl Sync for CpuRuntime
impl Unpin for CpuRuntime
impl UnsafeUnpin for CpuRuntime
impl UnwindSafe for CpuRuntime
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.