Skip to main content

ruda_tensor/api/
mod.rs

1pub(crate) mod stats;
2
3pub(crate) mod check;
4
5mod autodiff;
6mod base;
7mod bool;
8mod cartesian_grid;
9#[path = "cast.rs"]
10mod tensor_cast;
11mod float;
12mod fmod;
13mod int;
14mod numeric;
15mod moe;
16mod exchange;
17mod moe_exchange;
18pub use moe_exchange::{NativeMoeDispatched,dispatch_moe,combine_moe,received_moe_experts};
19mod options;
20mod orderable;
21mod pad;
22pub use pad::IntoPadding;
23mod take;
24mod transaction;
25pub mod sparse;
26
27mod trunc;
28
29pub use autodiff::*;
30pub use base::*;
31pub use cartesian_grid::cartesian_grid;
32pub use tensor_cast::*;
33pub use crate::element::cast;
34pub use float::{DEFAULT_ATOL, DEFAULT_RTOL};
35pub use numeric::*;
36pub use moe::{selected_router_weights,selected_router_weights_backward};
37pub use options::*;
38pub use transaction::*;
39
40pub use crate::tensor::IndexingUpdateOp;
41pub use crate::collective::{TensorCollective,ReplicatedTensorCollective,BroadcastTensorCollective,IntegerTensorCollective,VariableTensorCollective,VariableTensorExchange};
42pub use crate::frozen_awq::{FrozenAwqOps, FrozenAwqError};
43pub use crate::frozen_nf4::{FrozenNf4Ops,FrozenNf4Error,Nf4ProjectionOptions};
44pub use crate::moe::{MoeOps,MoeOptions,MoeSelectionOptions,MoeRouterScoring,MoeRouterWeightOptions,
45    MoeExpertStrategy,MoeCombineGradientStrategy,MoeBackward,MoeGradientSelection,MoeBackwardSelected,MoeAutodiffError};
46pub use crate::moe_exchange::{MoeDispatched,MoeDispatchOps,MoeCombineSelection,MoeCombineBackward,
47    MoeReceivedOptions,MoeReceivedSelection,MoeReceivedBackward,MoeReceivedOps};
48
49// Re-exported types
50pub use crate::{
51    BoolDType, BoolStore, DType, DataError, FloatDType, IntDType, TensorData, TensorMetadata,
52    TensorPrimitive, Tolerance,
53    distribution::*,
54    element::*,
55    indexing::*,
56    ops::TransactionPrimitive,
57    shape::*,
58    slice::*,
59    tensor::{Bool, Float, Int, TensorKind},
60};
61
62/// The activation module.
63pub mod activation;
64
65/// The backend module.
66pub mod backend {
67    pub use crate::backend::*;
68}
69
70/// The container module.
71pub mod container {
72    pub use crate::tensor::TensorContainer;
73}
74
75/// The grid module.
76pub mod grid;
77
78/// The linalg module.
79pub mod linalg;
80
81/// The loss module.
82pub mod loss;
83
84/// The neural network module.
85pub mod module;
86
87/// The signal processing module.
88pub mod signal;
89
90/// Operations on tensors module.
91pub mod ops {
92    pub use crate::backend::ops::*;
93    pub use crate::tensor::{
94        BoolElem, BoolTensor, Device, FloatElem, FloatTensor, IntElem, IntTensor, QuantizedTensor,
95    };
96}
97
98/// Tensor quantization module.
99pub mod quantization;
100
101#[cfg(feature = "api-std")]
102pub use report::*;
103
104#[cfg(feature = "api-std")]
105mod report;
106
107pub use ops::Device; // Re-export device so that it's available from `ruda_tensor::api::Device`.
108
109pub(crate) use check::macros::check;
110
111pub use crate::{
112    AllocationProperty, Bytes, DeviceSettings, StreamId, bf16, f16, get_device_settings, read_sync,
113    set_default_dtypes, try_read_sync,
114};