rstsr_core/
prelude.rs

1pub mod rstsr_traits {
2    pub use rstsr_common::prelude::rstsr_traits::*;
3
4    pub use crate::storage::conversion::DeviceChangeAPI;
5    pub use crate::storage::data::{DataAPI, DataCloneAPI, DataForceMutAPI, DataIntoCowAPI, DataMutAPI, DataOwnedAPI};
6    pub use crate::storage::device::{DeviceAPI, DeviceBaseAPI, DeviceRawAPI, DeviceStorageAPI};
7    pub use crate::tensor::asarray::AsArrayAPI;
8    pub use crate::tensor::creation::{
9        ArangeAPI, EmptyAPI, EmptyLikeAPI, EyeAPI, FromNestedArrayAPI, FullAPI, FullLikeAPI, LinspaceAPI, OnesAPI,
10        OnesLikeAPI, TrilAPI, TriuAPI, ZerosAPI, ZerosLikeAPI,
11    };
12    pub use crate::tensor::creation_from_tensor::{
13        ConcatAPI, DiagAPI, HStackAPI, MeshgridAPI, StackAPI, UnstackAPI, VStackAPI,
14    };
15    pub use crate::tensor::device_conversion::{TensorChangeFromDevice, TensorDeviceChangeAPI};
16    pub use crate::tensor::operators::op_binary_common::{
17        TensorATan2API, TensorCopySignAPI, TensorEqualAPI, TensorFloorDivideAPI, TensorGreaterAPI,
18        TensorGreaterEqualAPI, TensorHypotAPI, TensorLessAPI, TensorLessEqualAPI, TensorLogAddExpAPI, TensorMaximumAPI,
19        TensorMinimumAPI, TensorNotEqualAPI, TensorPowAPI,
20    };
21    pub use crate::tensor::operators::op_unary_common::{
22        TensorAbsAPI, TensorAcosAPI, TensorAcoshAPI, TensorAsinAPI, TensorAsinhAPI, TensorAtanAPI, TensorAtanhAPI,
23        TensorCeilAPI, TensorConjAPI, TensorCosAPI, TensorCoshAPI, TensorExpAPI, TensorExpm1API, TensorFloorAPI,
24        TensorImagAPI, TensorInvAPI, TensorIsFiniteAPI, TensorIsInfAPI, TensorIsNanAPI, TensorLog10API, TensorLog2API,
25        TensorLogAPI, TensorRealAPI, TensorRoundAPI, TensorSignAPI, TensorSignBitAPI, TensorSinAPI, TensorSinhAPI,
26        TensorSqrtAPI, TensorSquareAPI, TensorTanAPI, TensorTanhAPI, TensorTruncAPI,
27    };
28    pub use crate::tensor::ownership_conversion::{TensorIntoOwnedAPI, TensorViewAPI, TensorViewMutAPI};
29    pub use crate::tensor::reduction::TensorSumBoolAPI;
30
31    #[cfg(feature = "rayon")]
32    pub use crate::feature_rayon::DeviceRayonAPI;
33}
34
35pub mod rstsr_structs {
36    pub use rstsr_common::prelude::rstsr_structs::*;
37
38    pub use crate::device_cpu_serial::device::DeviceCpuSerial;
39    #[cfg(feature = "faer")]
40    pub use crate::device_faer::device::DeviceFaer;
41    pub use crate::DeviceCpu;
42
43    pub use crate::tensor::tensor_mutable::TensorMutable;
44    pub use crate::{
45        Tensor, TensorAny, TensorArc, TensorBase, TensorCow, TensorMut, TensorRef, TensorReference, TensorView,
46        TensorViewMut,
47    };
48}
49
50pub mod rstsr_funcs {
51    pub use crate::tensor::adv_indexing::{bool_select, bool_select_f, index_select, index_select_f, take, take_f};
52    pub use crate::tensor::asarray::{asarray, asarray_f};
53    pub use crate::tensor::creation::{
54        arange, arange_f, assume_init, assume_init_f, empty, empty_f, empty_like, empty_like_f, eye, eye_f, full,
55        full_f, full_like, full_like_f, linspace, linspace_f, ones, ones_f, ones_like, ones_like_f, tril, tril_f, triu,
56        triu_f, uninit, uninit_f, zeros, zeros_f, zeros_like, zeros_like_f,
57    };
58    pub use crate::tensor::creation_from_tensor::{
59        concat, concat_f, concatenate, concatenate_f, diag, diag_f, hstack, hstack_f, meshgrid, meshgrid_f, stack,
60        stack_f, unstack, unstack_f, vstack, vstack_f,
61    };
62    pub use crate::tensor::indexing::{
63        diagonal, diagonal_f, diagonal_mut, diagonal_mut_f, into_diagonal, into_diagonal_f, into_diagonal_mut,
64        into_diagonal_mut_f, into_slice, into_slice_f, slice, slice_f, slice_mut, slice_mut_f,
65    };
66    pub use crate::tensor::manuplication::exports::{
67        broadcast_arrays, broadcast_arrays_f, change_contig, change_contig_f, change_layout, change_layout_f,
68        change_shape, change_shape_f, expand_dims, expand_dims_f, flip, flip_f, into_broadcast, into_broadcast_f,
69        into_contig, into_contig_f, into_dim, into_dim_f, into_dyn, into_expand_dims, into_expand_dims_f, into_flip,
70        into_flip_f, into_layout, into_layout_f, into_permute_dims, into_permute_dims_f, into_reverse_axes, into_shape,
71        into_shape_assume_contig, into_shape_assume_contig_f, into_shape_f, into_squeeze, into_squeeze_f,
72        into_swapaxes, into_swapaxes_f, into_transpose, into_transpose_f, permute_dims, permute_dims_f, reshape,
73        reshape_assume_contig, reshape_assume_contig_f, reshape_f, reverse_axes, squeeze, squeeze_f, swapaxes,
74        swapaxes_f, to_broadcast, to_broadcast_f, to_contig, to_contig_f, to_dim, to_dim_f, to_dyn, to_layout,
75        to_layout_f, to_shape, to_shape_assume_contig, to_shape_assume_contig_f, to_shape_f, transpose, transpose_f,
76    };
77
78    // binary arithmetics
79    pub use crate::tensor::operators::{
80        add, add_f, add_with_output, add_with_output_f, div, div_f, div_with_output, div_with_output_f, matmul,
81        matmul_f, matmul_with_output, matmul_with_output_f, mul, mul_f, mul_with_output, mul_with_output_f, rem, rem_f,
82        rem_with_output, rem_with_output_f, sub, sub_f, sub_with_output, sub_with_output_f,
83    };
84    // binary arithmetics with assignment
85    pub use crate::tensor::operators::{
86        add_assign, add_assign_f, div_assign, div_assign_f, mul_assign, mul_assign_f, rem_assign, rem_assign_f,
87        sub_assign, sub_assign_f,
88    };
89    // binary bitwise
90    pub use crate::tensor::operators::{
91        bitand, bitand_f, bitand_with_output, bitand_with_output_f, bitor, bitor_f, bitor_with_output,
92        bitor_with_output_f, bitxor, bitxor_f, bitxor_with_output, bitxor_with_output_f, shl, shl_f, shl_with_output,
93        shl_with_output_f, shr, shr_f, shr_with_output, shr_with_output_f,
94    };
95    // binary bitwise with assignment
96    pub use crate::tensor::operators::{
97        bitand_assign, bitand_assign_f, bitor_assign, bitor_assign_f, bitxor_assign, bitxor_assign_f, shl_assign,
98        shl_assign_f, shr_assign, shr_assign_f,
99    };
100    // unary arithmetics
101    pub use crate::tensor::operators::{neg, neg_f, not, not_f};
102    // unary common functions
103    pub use crate::tensor::operators::{
104        abs, abs_f, acos, acos_f, acosh, acosh_f, asin, asin_f, asinh, asinh_f, atan, atan_f, atanh, atanh_f, ceil,
105        ceil_f, conj, conj_f, cos, cos_f, cosh, cosh_f, exp, exp_f, expm1, expm1_f, floor, floor_f, imag, imag_f, inv,
106        inv_f, is_finite, is_finite_f, is_inf, is_inf_f, is_nan, is_nan_f, log, log10, log10_f, log2, log2_f, log_f,
107        real, real_f, reciprocal, reciprocal_f, round, round_f, sign, sign_f, signbit, signbit_f, sin, sin_f, sinh,
108        sinh_f, sqrt, sqrt_f, square, square_f, tan, tan_f, tanh, tanh_f, trunc, trunc_f,
109    };
110    // binary common functions
111    pub use crate::tensor::operators::{
112        atan2, atan2_f, copysign, copysign_f, eq, eq_f, equal, equal_f, equal_than, equal_than_f, floor_divide,
113        floor_divide_f, ge, ge_f, greater, greater_equal, greater_equal_f, greater_equal_to, greater_equal_to_f,
114        greater_f, greater_than, greater_than_f, gt, gt_f, hypot, hypot_f, le, le_f, less, less_equal, less_equal_f,
115        less_equal_to, less_equal_to_f, less_f, less_than, less_than_f, log_add_exp, log_add_exp_f, lt, lt_f, maximum,
116        maximum_f, minimum, minimum_f, ne, ne_f, nextafter, nextafter_f, not_equal, not_equal_f, not_equal_to,
117        not_equal_to_f, pow, pow_f,
118    };
119    // reduction
120    pub use crate::tensor::reduction::{
121        all, all_all, all_all_f, all_axes, all_axes_f, all_f, allclose, allclose_f, any, any_all, any_all_f, any_axes,
122        any_axes_f, any_f, argmax, argmax_all, argmax_all_f, argmax_axes, argmax_axes_f, argmax_f, argmin, argmin_all,
123        argmin_all_f, argmin_axes, argmin_axes_f, argmin_f, count_nonzero, count_nonzero_all, count_nonzero_all_f,
124        count_nonzero_axes, count_nonzero_axes_f, count_nonzero_f, l2_norm, l2_norm_all, l2_norm_all_f, l2_norm_axes,
125        l2_norm_axes_f, l2_norm_f, max, max_all, max_all_f, max_axes, max_axes_f, max_f, mean, mean_all, mean_all_f,
126        mean_axes, mean_axes_f, mean_f, min, min_all, min_all_f, min_axes, min_axes_f, min_f, prod, prod_all,
127        prod_all_f, prod_axes, prod_axes_f, prod_f, std, std_all, std_all_f, std_axes, std_axes_f, std_f, sum, sum_all,
128        sum_all_f, sum_axes, sum_axes_f, sum_f, unraveled_argmax, unraveled_argmax_all, unraveled_argmax_all_f,
129        unraveled_argmax_axes, unraveled_argmax_axes_f, unraveled_argmax_f, unraveled_argmin, unraveled_argmin_all,
130        unraveled_argmin_all_f, unraveled_argmin_axes, unraveled_argmin_axes_f, unraveled_argmin_f, var, var_all,
131        var_all_f, var_axes, var_axes_f, var_f,
132    };
133}
134
135pub mod rstsr_macros {
136    pub use crate::{allclose, tensor_from_nested};
137    pub use rstsr_common::prelude::rstsr_macros::*;
138}
139
140// final re-exports
141
142pub use rstsr_macros::*;
143pub use rstsr_structs::*;
144pub use rstsr_traits::*;
145
146#[allow(unused_imports)]
147pub mod rt {
148    pub use rstsr_common::prelude::rt::*;
149
150    pub use super::rstsr_funcs;
151    pub use super::rstsr_macros;
152    pub use super::rstsr_structs;
153    pub use super::rstsr_traits;
154
155    pub use super::rstsr_funcs::*;
156    pub use super::rstsr_macros::*;
157    pub use super::rstsr_structs::*;
158    pub use super::rstsr_traits::*;
159}