pub struct Native;Expand description
The native backend: programs run as native code compiled by rustc.
Scalars are Rust values, arrays are NativeArrays, and control flow is
real branches and loops.
Trait Implementations§
Source§impl Backend for Native
impl Backend for Native
Source§type Array<T: Element> = NativeArray<T>
type Array<T: Element> = NativeArray<T>
An array.
Source§fn integer_pow<T: Element>(x: T, y: i32) -> T
fn integer_pow<T: Element>(x: T, y: i32) -> T
x^y for a static integer y.Source§fn bitcast<T: Element, U: Element>(x: T) -> U
fn bitcast<T: Element, U: Element>(x: T) -> U
Reinterpretation of the bits as another type of the same size.
Source§fn to_real<T: Element>(op: ToReal, x: T) -> T::Real
fn to_real<T: Element>(op: ToReal, x: T) -> T::Real
abs, real, or imag (real and imag of complex numbers).Source§fn complex<C: Element>(re: C::Real, im: C::Real) -> C
fn complex<C: Element>(re: C::Real, im: C::Real) -> C
A complex number from its parts (
lax.complex).Source§fn constant<T: Element>(x: &NativeArray<T>) -> NativeArray<T>
fn constant<T: Element>(x: &NativeArray<T>) -> NativeArray<T>
A constant array.
Source§fn to_array<T: Element>(x: T) -> NativeArray<T>
fn to_array<T: Element>(x: T) -> NativeArray<T>
A scalar as an array of rank 0.
Source§fn to_scalar<T: Element>(x: &NativeArray<T>) -> T
fn to_scalar<T: Element>(x: &NativeArray<T>) -> T
An array of rank 0 as a scalar.
Source§fn a_unary<T: Element>(op: UnaryOp, x: &NativeArray<T>) -> NativeArray<T>
fn a_unary<T: Element>(op: UnaryOp, x: &NativeArray<T>) -> NativeArray<T>
Elementwise unary operation.
Source§fn a_binary<T: Element>(
op: BinaryOp,
x: &NativeArray<T>,
y: &NativeArray<T>,
) -> NativeArray<T>
fn a_binary<T: Element>( op: BinaryOp, x: &NativeArray<T>, y: &NativeArray<T>, ) -> NativeArray<T>
Elementwise binary operation on arrays of the same shape.
Source§fn a_ternary<T: Element>(
op: TernaryOp,
x: &NativeArray<T>,
y: &NativeArray<T>,
z: &NativeArray<T>,
) -> NativeArray<T>
fn a_ternary<T: Element>( op: TernaryOp, x: &NativeArray<T>, y: &NativeArray<T>, z: &NativeArray<T>, ) -> NativeArray<T>
Elementwise ternary operation on arrays of the same shape.
Source§fn a_compare<T: Element>(
op: CompareOp,
x: &NativeArray<T>,
y: &NativeArray<T>,
) -> NativeArray<bool>
fn a_compare<T: Element>( op: CompareOp, x: &NativeArray<T>, y: &NativeArray<T>, ) -> NativeArray<bool>
Elementwise comparison of arrays of the same shape.
Source§fn a_is_finite<T: Element>(x: &NativeArray<T>) -> NativeArray<bool>
fn a_is_finite<T: Element>(x: &NativeArray<T>) -> NativeArray<bool>
Elementwise
is_finite.Source§fn a_integer_pow<T: Element>(x: &NativeArray<T>, y: i32) -> NativeArray<T>
fn a_integer_pow<T: Element>(x: &NativeArray<T>, y: i32) -> NativeArray<T>
Elementwise
integer_pow.Source§fn a_cast<T: Element, U: Element>(x: &NativeArray<T>) -> NativeArray<U>
fn a_cast<T: Element, U: Element>(x: &NativeArray<T>) -> NativeArray<U>
Elementwise conversion.
Source§fn a_bitcast<T: Element, U: Element>(x: &NativeArray<T>) -> NativeArray<U>
fn a_bitcast<T: Element, U: Element>(x: &NativeArray<T>) -> NativeArray<U>
Elementwise bit reinterpretation.
Source§fn a_to_real<T: Element>(op: ToReal, x: &NativeArray<T>) -> NativeArray<T::Real>
fn a_to_real<T: Element>(op: ToReal, x: &NativeArray<T>) -> NativeArray<T::Real>
Elementwise
abs, real, or imag.Source§fn a_complex<C: Element>(
re: &NativeArray<C::Real>,
im: &NativeArray<C::Real>,
) -> NativeArray<C>
fn a_complex<C: Element>( re: &NativeArray<C::Real>, im: &NativeArray<C::Real>, ) -> NativeArray<C>
Elementwise
complex of arrays of the same shape.Source§fn a_conj<T: Element>(x: &NativeArray<T>) -> NativeArray<T>
fn a_conj<T: Element>(x: &NativeArray<T>) -> NativeArray<T>
Elementwise complex conjugate.
Source§fn a_select<T: Element>(
c: &NativeArray<bool>,
t: &NativeArray<T>,
f: &NativeArray<T>,
) -> NativeArray<T>
fn a_select<T: Element>( c: &NativeArray<bool>, t: &NativeArray<T>, f: &NativeArray<T>, ) -> NativeArray<T>
select_n(c, f, t): c is a scalar or has the shape of the cases.Source§fn a_clamp<T: Element>(
lo: &NativeArray<T>,
x: &NativeArray<T>,
hi: &NativeArray<T>,
) -> NativeArray<T>
fn a_clamp<T: Element>( lo: &NativeArray<T>, x: &NativeArray<T>, hi: &NativeArray<T>, ) -> NativeArray<T>
clamp(lo, x, hi): bounds are scalars or have the shape of x.Source§fn broadcast_in_dim<T: Element>(
x: &NativeArray<T>,
shape: &[usize],
dims: &[usize],
) -> NativeArray<T>
fn broadcast_in_dim<T: Element>( x: &NativeArray<T>, shape: &[usize], dims: &[usize], ) -> NativeArray<T>
broadcast_in_dim.Source§fn reshape<T: Element>(x: &NativeArray<T>, shape: &[usize]) -> NativeArray<T>
fn reshape<T: Element>(x: &NativeArray<T>, shape: &[usize]) -> NativeArray<T>
reshape.Source§fn transpose<T: Element>(x: &NativeArray<T>, perm: &[usize]) -> NativeArray<T>
fn transpose<T: Element>(x: &NativeArray<T>, perm: &[usize]) -> NativeArray<T>
transpose.Source§fn slice<T: Element>(
x: &NativeArray<T>,
start: &[usize],
limit: &[usize],
strides: &[usize],
) -> NativeArray<T>
fn slice<T: Element>( x: &NativeArray<T>, start: &[usize], limit: &[usize], strides: &[usize], ) -> NativeArray<T>
slice.Source§fn dynamic_slice<T: Element, I: Element>(
x: &NativeArray<T>,
starts: &[I],
sizes: &[usize],
) -> NativeArray<T>
fn dynamic_slice<T: Element, I: Element>( x: &NativeArray<T>, starts: &[I], sizes: &[usize], ) -> NativeArray<T>
dynamic_slice (start indices are clamped).Source§fn dynamic_update_slice<T: Element, I: Element>(
x: &NativeArray<T>,
update: &NativeArray<T>,
starts: &[I],
) -> NativeArray<T>
fn dynamic_update_slice<T: Element, I: Element>( x: &NativeArray<T>, update: &NativeArray<T>, starts: &[I], ) -> NativeArray<T>
dynamic_update_slice (start indices are clamped).Source§fn concatenate<T: Element>(xs: &[NativeArray<T>], dim: usize) -> NativeArray<T>
fn concatenate<T: Element>(xs: &[NativeArray<T>], dim: usize) -> NativeArray<T>
concatenate.Source§fn pad<T: Element>(
x: &NativeArray<T>,
value: T,
config: &[(i64, i64, usize)],
) -> NativeArray<T>
fn pad<T: Element>( x: &NativeArray<T>, value: T, config: &[(i64, i64, usize)], ) -> NativeArray<T>
pad.Source§fn rev<T: Element>(x: &NativeArray<T>, dims: &[usize]) -> NativeArray<T>
fn rev<T: Element>(x: &NativeArray<T>, dims: &[usize]) -> NativeArray<T>
rev.Source§fn reduce<T: Element>(
op: ReduceOp,
x: &NativeArray<T>,
axes: &[usize],
) -> NativeArray<T>
fn reduce<T: Element>( op: ReduceOp, x: &NativeArray<T>, axes: &[usize], ) -> NativeArray<T>
A reduction over
axes.Source§fn arg_min_max<T: Element, I: Element>(
x: &NativeArray<T>,
axis: usize,
max: bool,
) -> NativeArray<I>
fn arg_min_max<T: Element, I: Element>( x: &NativeArray<T>, axis: usize, max: bool, ) -> NativeArray<I>
argmax or argmin.Source§fn sort(
operands: &[HostArray],
dimension: usize,
is_stable: bool,
num_keys: usize,
) -> Vec<HostArray>
fn sort( operands: &[HostArray], dimension: usize, is_stable: bool, num_keys: usize, ) -> Vec<HostArray>
sort of operands of the same shape (of any element types) along
dimension, lexicographically by the first num_keys of them.Source§fn cumulative<T: Element>(
op: CumulativeOp,
x: &NativeArray<T>,
axis: usize,
reverse: bool,
) -> NativeArray<T>
fn cumulative<T: Element>( op: CumulativeOp, x: &NativeArray<T>, axis: usize, reverse: bool, ) -> NativeArray<T>
A cumulative reduction along
axis (cumsum and the like), from
the end with reverse.Source§fn top_k<T: Element>(
x: &NativeArray<T>,
k: usize,
axis: usize,
) -> (NativeArray<T>, NativeArray<i32>)
fn top_k<T: Element>( x: &NativeArray<T>, k: usize, axis: usize, ) -> (NativeArray<T>, NativeArray<i32>)
top_k along axis: the k largest elements in descending order,
and their indices.Source§fn cholesky<T: LinalgScalar>(x: &NativeArray<T>) -> NativeArray<T>
fn cholesky<T: LinalgScalar>(x: &NativeArray<T>) -> NativeArray<T>
cholesky of a batch of matrices (see lax::linalg::cholesky).Source§fn triangular_solve<T: LinalgScalar>(
a: &NativeArray<T>,
b: &NativeArray<T>,
options: TriangularSolveOptions,
) -> NativeArray<T>
fn triangular_solve<T: LinalgScalar>( a: &NativeArray<T>, b: &NativeArray<T>, options: TriangularSolveOptions, ) -> NativeArray<T>
triangular_solve of batches of matrices.Source§fn lu<T: LinalgScalar>(
x: &NativeArray<T>,
) -> (NativeArray<T>, NativeArray<i32>, NativeArray<i32>)
fn lu<T: LinalgScalar>( x: &NativeArray<T>, ) -> (NativeArray<T>, NativeArray<i32>, NativeArray<i32>)
lu of a batch of matrices: the factors, the pivots, and the
permutation.Source§fn lu_pivots_to_permutation(
pivots: &NativeArray<i32>,
size: usize,
) -> NativeArray<i32>
fn lu_pivots_to_permutation( pivots: &NativeArray<i32>, size: usize, ) -> NativeArray<i32>
lu_pivots_to_permutation.Source§fn qr<T: LinalgScalar>(
x: &NativeArray<T>,
full_matrices: bool,
) -> (NativeArray<T>, NativeArray<T>)
fn qr<T: LinalgScalar>( x: &NativeArray<T>, full_matrices: bool, ) -> (NativeArray<T>, NativeArray<T>)
qr of a batch of matrices: q and r.Source§fn qr_pivoting<T: LinalgScalar>(
x: &NativeArray<T>,
full_matrices: bool,
) -> (NativeArray<T>, NativeArray<T>, NativeArray<i32>)
fn qr_pivoting<T: LinalgScalar>( x: &NativeArray<T>, full_matrices: bool, ) -> (NativeArray<T>, NativeArray<T>, NativeArray<i32>)
qr with column pivoting of a batch of matrices: q, r, and the
permutation.Source§fn eigh<T: LinalgScalar>(
x: &NativeArray<T>,
lower: bool,
sort_eigenvalues: bool,
subset_by_index: Option<(usize, usize)>,
algorithm: Option<EighImplementation>,
) -> (NativeArray<T>, NativeArray<T::Real>)
fn eigh<T: LinalgScalar>( x: &NativeArray<T>, lower: bool, sort_eigenvalues: bool, subset_by_index: Option<(usize, usize)>, algorithm: Option<EighImplementation>, ) -> (NativeArray<T>, NativeArray<T::Real>)
eigh of a batch of symmetric matrices: the eigenvectors and the
eigenvalues (of the range subset_by_index of indices, if given).Source§fn schur<T: LinalgScalar>(
x: &NativeArray<T>,
compute_schur_vectors: bool,
) -> (NativeArray<T>, Option<NativeArray<T>>)
fn schur<T: LinalgScalar>( x: &NativeArray<T>, compute_schur_vectors: bool, ) -> (NativeArray<T>, Option<NativeArray<T>>)
schur of a batch of square matrices: t and, with
compute_schur_vectors, z.Source§fn hessenberg<T: LinalgScalar>(
x: &NativeArray<T>,
) -> (NativeArray<T>, NativeArray<T>)
fn hessenberg<T: LinalgScalar>( x: &NativeArray<T>, ) -> (NativeArray<T>, NativeArray<T>)
hessenberg of a batch of square matrices: the reduced matrices and
the factors of the reflectors.Source§fn householder_product<T: LinalgScalar>(
a: &NativeArray<T>,
taus: &NativeArray<T>,
) -> NativeArray<T>
fn householder_product<T: LinalgScalar>( a: &NativeArray<T>, taus: &NativeArray<T>, ) -> NativeArray<T>
householder_product of reflectors and their factors.Source§fn ormqr<T: LinalgScalar>(
a: &NativeArray<T>,
taus: &NativeArray<T>,
c: &NativeArray<T>,
left: bool,
transpose: bool,
) -> NativeArray<T>
fn ormqr<T: LinalgScalar>( a: &NativeArray<T>, taus: &NativeArray<T>, c: &NativeArray<T>, left: bool, transpose: bool, ) -> NativeArray<T>
ormqr: c times Q (or Q^H) of the reflectors.Source§fn cholesky_update<T: LinalgFloat>(
r: &NativeArray<T>,
w: &NativeArray<T>,
) -> NativeArray<T>
fn cholesky_update<T: LinalgFloat>( r: &NativeArray<T>, w: &NativeArray<T>, ) -> NativeArray<T>
cholesky_update: the rank-1 update by w of the upper triangular
Cholesky factors r.Source§fn symmetric_product<T: LinalgFloat>(
a: &NativeArray<T>,
c: &NativeArray<T>,
alpha: f64,
beta: f64,
) -> NativeArray<T>
fn symmetric_product<T: LinalgFloat>( a: &NativeArray<T>, c: &NativeArray<T>, alpha: f64, beta: f64, ) -> NativeArray<T>
symmetric_product: alpha a a^T + beta c.Source§fn tridiagonal<T: LinalgScalar>(
x: &NativeArray<T>,
lower: bool,
) -> (NativeArray<T>, NativeArray<T::Real>, NativeArray<T::Real>, NativeArray<T>)
fn tridiagonal<T: LinalgScalar>( x: &NativeArray<T>, lower: bool, ) -> (NativeArray<T>, NativeArray<T::Real>, NativeArray<T::Real>, NativeArray<T>)
tridiagonal of a batch of Hermitian matrices: the reduced matrices,
the real diagonals and off-diagonals, and the factors of the
reflectors.Source§fn tridiagonal_solve<T: LinalgScalar>(
dl: &NativeArray<T>,
d: &NativeArray<T>,
du: &NativeArray<T>,
b: &NativeArray<T>,
perturb_singular: bool,
) -> NativeArray<T>
fn tridiagonal_solve<T: LinalgScalar>( dl: &NativeArray<T>, d: &NativeArray<T>, du: &NativeArray<T>, b: &NativeArray<T>, perturb_singular: bool, ) -> NativeArray<T>
tridiagonal_solve: the solution of the tridiagonal systems of the
diagonals dl, d, and du ([..., m]) with the right-hand sides
b ([..., m, n]).Source§fn eig<T: LinalgScalar>(
x: &NativeArray<T>,
left: bool,
right: bool,
enable_eigvec_derivs: bool,
) -> (NativeArray<<T as LinalgScalar>::Complex>, Option<NativeArray<<T as LinalgScalar>::Complex>>, Option<NativeArray<<T as LinalgScalar>::Complex>>)
fn eig<T: LinalgScalar>( x: &NativeArray<T>, left: bool, right: bool, enable_eigvec_derivs: bool, ) -> (NativeArray<<T as LinalgScalar>::Complex>, Option<NativeArray<<T as LinalgScalar>::Complex>>, Option<NativeArray<<T as LinalgScalar>::Complex>>)
eig of a batch of general matrices: the complex eigenvalues, and
the left and right eigenvectors that are requested.Source§fn svd<T: LinalgScalar>(
x: &NativeArray<T>,
full_matrices: bool,
compute_uv: bool,
subset_by_index: Option<(usize, usize)>,
algorithm: Option<SvdAlgorithm>,
) -> (NativeArray<T::Real>, Option<(NativeArray<T>, NativeArray<T>)>)
fn svd<T: LinalgScalar>( x: &NativeArray<T>, full_matrices: bool, compute_uv: bool, subset_by_index: Option<(usize, usize)>, algorithm: Option<SvdAlgorithm>, ) -> (NativeArray<T::Real>, Option<(NativeArray<T>, NativeArray<T>)>)
svd of a batch of matrices: the singular values, and u and vt
with compute_uv (of the range subset_by_index of indices, if
given).Source§fn fft<T: Element, U: Element>(
x: &NativeArray<T>,
fft_type: FftType,
fft_lengths: &[usize],
) -> NativeArray<U>
fn fft<T: Element, U: Element>( x: &NativeArray<T>, fft_type: FftType, fft_lengths: &[usize], ) -> NativeArray<U>
fft of the trailing axes, from T to U (complex to complex,
real to complex, or complex to real).Source§fn dot_general<T: Element, U: Element>(
l: &NativeArray<T>,
r: &NativeArray<T>,
dims: &DotDims,
precision: Precision,
) -> NativeArray<U>
fn dot_general<T: Element, U: Element>( l: &NativeArray<T>, r: &NativeArray<T>, dims: &DotDims, precision: Precision, ) -> NativeArray<U>
dot_general, computing in U (the operand type unless a preferred
type is given).Source§fn conv_general_dilated<T: Element, U: Element>(
lhs: &NativeArray<T>,
rhs: &NativeArray<T>,
window: &ConvWindow<'_>,
dims: &ConvDims,
groups: (usize, usize),
precision: Precision,
) -> NativeArray<U>
fn conv_general_dilated<T: Element, U: Element>( lhs: &NativeArray<T>, rhs: &NativeArray<T>, window: &ConvWindow<'_>, dims: &ConvDims, groups: (usize, usize), precision: Precision, ) -> NativeArray<U>
conv_general_dilated with (feature_group_count, batch_group_count) groups, computing in U (the operand type unless
a preferred type is given).Source§fn reduce_window<T: Element>(
op: ReduceOp,
x: &NativeArray<T>,
window: &Window<'_>,
) -> NativeArray<T>
fn reduce_window<T: Element>( op: ReduceOp, x: &NativeArray<T>, window: &Window<'_>, ) -> NativeArray<T>
reduce_window_sum, reduce_window_max, or reduce_window_min.Source§fn select_and_scatter_add<T: Element>(
source: &NativeArray<T>,
operand: &NativeArray<T>,
select_prim: SelectPrim,
window: &Window<'_>,
) -> NativeArray<T>
fn select_and_scatter_add<T: Element>( source: &NativeArray<T>, operand: &NativeArray<T>, select_prim: SelectPrim, window: &Window<'_>, ) -> NativeArray<T>
select_and_scatter_add (the window’s dilations must be 1).Source§fn select_and_gather_add<T: Element>(
tangents: &NativeArray<T>,
operand: &NativeArray<T>,
select_prim: SelectPrim,
window: &Window<'_>,
) -> NativeArray<T>
fn select_and_gather_add<T: Element>( tangents: &NativeArray<T>, operand: &NativeArray<T>, select_prim: SelectPrim, window: &Window<'_>, ) -> NativeArray<T>
select_and_gather_add.Source§fn gather<T: Element, I: Element>(
x: &NativeArray<T>,
indices: &NativeArray<I>,
dims: &GatherDims,
sizes: &[usize],
mode: GatherScatterMode,
sorted_unique: bool,
) -> NativeArray<T>
fn gather<T: Element, I: Element>( x: &NativeArray<T>, indices: &NativeArray<I>, dims: &GatherDims, sizes: &[usize], mode: GatherScatterMode, sorted_unique: bool, ) -> NativeArray<T>
gather.Source§fn scatter<T: Element, I: Element>(
combine: Option<BinaryOp>,
x: &NativeArray<T>,
indices: &NativeArray<I>,
updates: &NativeArray<T>,
dims: &ScatterDims,
mode: GatherScatterMode,
sorted_unique: bool,
) -> NativeArray<T>
fn scatter<T: Element, I: Element>( combine: Option<BinaryOp>, x: &NativeArray<T>, indices: &NativeArray<I>, updates: &NativeArray<T>, dims: &ScatterDims, mode: GatherScatterMode, sorted_unique: bool, ) -> NativeArray<T>
A scatter: replaces (
combine is None) or combines updates.Source§fn cond<S: Tree<Self>, R: Tree<Self>>(
index: I32<Native>,
branches: &[&dyn Fn(S) -> R],
operand: S,
) -> R
fn cond<S: Tree<Self>, R: Tree<Self>>( index: I32<Native>, branches: &[&dyn Fn(S) -> R], operand: S, ) -> R
Calls
branches[index] on operand; an index out of range calls the
last branch, as stablehlo.case does.Source§fn while_loop<C: Tree<Self>>(
cond: &dyn Fn(&C) -> Bool<Native>,
body: &dyn Fn(C) -> C,
init: C,
) -> C
fn while_loop<C: Tree<Self>>( cond: &dyn Fn(&C) -> Bool<Native>, body: &dyn Fn(C) -> C, init: C, ) -> C
Repeats
body while cond holds.Source§fn scan<C: Tree<Self>, X: Tree<Self>, Y: Tree<Self>>(
f: &dyn Fn(C, X) -> (C, Y),
init: C,
xs: X,
length: usize,
reverse: bool,
) -> (C, Y)
fn scan<C: Tree<Self>, X: Tree<Self>, Y: Tree<Self>>( f: &dyn Fn(C, X) -> (C, Y), init: C, xs: X, length: usize, reverse: bool, ) -> (C, Y)
A loop over the leading dimension of the arrays of
xs.Source§fn fori_loop<C: Tree<Self>>(
lo: I32<Native>,
hi: I32<Native>,
body: &dyn Fn(I32<Native>, C) -> C,
init: C,
) -> C
fn fori_loop<C: Tree<Self>>( lo: I32<Native>, hi: I32<Native>, body: &dyn Fn(I32<Native>, C) -> C, init: C, ) -> C
for i in lo..hi { state = body(i, state) }.Source§fn scalar_leaf<T: Element>(x: T) -> HostArray
fn scalar_leaf<T: Element>(x: T) -> HostArray
A scalar as a pytree leaf.
Source§fn leaf_scalar<T: Element>(l: HostArray) -> T
fn leaf_scalar<T: Element>(l: HostArray) -> T
A pytree leaf as a scalar.
Source§fn array_leaf<T: Element>(x: &NativeArray<T>) -> HostArray
fn array_leaf<T: Element>(x: &NativeArray<T>) -> HostArray
An array as a pytree leaf.
Source§fn leaf_array<T: Element>(l: HostArray) -> NativeArray<T>
fn leaf_array<T: Element>(l: HostArray) -> NativeArray<T>
A pytree leaf as an array.
Source§fn host_callback(
callback: &HostCallback,
args: &[HostArray],
outputs: &[AVal],
) -> Vec<HostArray>
fn host_callback( callback: &HostCallback, args: &[HostArray], outputs: &[AVal], ) -> Vec<HostArray>
host_callback: callback on the leaves args, whose results have
the types outputs.Source§fn custom_jvp<I: Tree<Self>, O: Tree<Self>>(
f: &dyn Fn(I) -> O,
jvp: &dyn Fn(I, I) -> (O, O),
primals: I,
) -> O
fn custom_jvp<I: Tree<Self>, O: Tree<Self>>( f: &dyn Fn(I) -> O, jvp: &dyn Fn(I, I) -> (O, O), primals: I, ) -> O
Source§fn custom_vjp<I: Tree<Self>, O: Tree<Self>, R: Tree<Self>>(
f: &dyn Fn(I) -> O,
fwd: &dyn Fn(I) -> (O, R),
bwd: &dyn Fn(R, O) -> I,
primals: I,
) -> O
fn custom_vjp<I: Tree<Self>, O: Tree<Self>, R: Tree<Self>>( f: &dyn Fn(I) -> O, fwd: &dyn Fn(I) -> (O, R), bwd: &dyn Fn(R, O) -> I, primals: I, ) -> O
Source§fn checkpoint<I: Tree<Self>, O: Tree<Self>>(f: &dyn Fn(I) -> O, input: I) -> O
fn checkpoint<I: Tree<Self>, O: Tree<Self>>(f: &dyn Fn(I) -> O, input: I) -> O
f(input), whose intermediate values reverse mode recomputes (see
lax::checkpoint).impl Copy for Native
impl Eq for Native
impl StructuralPartialEq for Native
Auto Trait Implementations§
impl Freeze for Native
impl RefUnwindSafe for Native
impl Send for Native
impl Sync for Native
impl Unpin for Native
impl UnsafeUnpin for Native
impl UnwindSafe for Native
Blanket Implementations§
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
Mutably borrows from an owned value. Read more