Skip to main content

Module prelude

Module prelude 

Source
Expand description

The items most programs use: use ruxla_core::prelude::*; (or ruxla::prelude::*).

§Examples

use ruxla_core::prelude::*;

fn energy<B: Backend>(x: &Array<B, f32>) -> F32<B> {
    jnp::sum(x.square(), ALL).to_scalar() * 0.5
}
let x = Array::<Native, f32>::from_vec(vec![1.0, 2.0], [2]);
assert_eq!(energy(&x).value(), 2.5);

Re-exports§

pub use crate::ALL;
pub use crate::Array;
pub use crate::ArrayLike;
pub use crate::Backend;
pub use crate::Bool;
pub use crate::C64;
pub use crate::C128;
pub use crate::ComplexFloat;
pub use crate::F32;
pub use crate::F64;
pub use crate::Float;
pub use crate::I32;
pub use crate::I64;
pub use crate::Inexact;
pub use crate::Int;
pub use crate::Key;
pub use crate::Native;
pub use crate::Num;
pub use crate::Numeric;
pub use crate::OnDevice;
pub use crate::RealFloat;
pub use crate::Scalar;
pub use crate::Trace;
pub use crate::Tree;
pub use crate::U8;
pub use crate::U32;
pub use crate::device_put;
pub use crate::jit;
pub use crate::jit;
pub use crate::jnp;
pub use crate::lax;
pub use crate::random;
pub use crate::vmap;
pub use crate::vmap;

Traits§

Element
A Rust type that is an element type of ruxla. It is implemented for bool, the integer types, f16, bf16, f32, f64, c64, and c128.

Type Aliases§

c64
A complex number made of two f32s (complex64).
c128
A complex number made of two f64s (complex128).

Derive Macros§

Tree
Derives Tree<B> for a struct with named fields whose first type parameter is the backend B.