@@ -18,8 +18,8 @@ use std::ops::Add;
18
18
/// A quick example:
19
19
///
20
20
/// ```
21
- /// use numeric::Tensor ;
22
- /// let t = Tensor::new(vec![1.0f64, 3.0, 2.0, 2.0]).reshape(&[2, 2]);
21
+ /// use numeric as nr ;
22
+ /// let t = nr:: Tensor::new(vec![1.0f64, 3.0, 2.0, 2.0]).reshape(&[2, 2]);
23
23
/// println!("t = {}", t);
24
24
/// ```
25
25
///
@@ -435,13 +435,13 @@ impl<T: TensorTrait> Tensor<T> {
435
435
/// `AxisIndex` enum to specify indexing for each axis.
436
436
///
437
437
/// ```
438
- /// use numeric::{DoubleTensor, Ellipsis, StridedSlice, Index, Full} ;
438
+ /// use numeric as nr ;
439
439
///
440
- /// let t = DoubleTensor ::ones(&[2, 3, 4]);
440
+ /// let t: nr::Tensor<f64> = nr::Tensor ::ones(&[2, 3, 4]);
441
441
///
442
- /// t.index(&[Ellipsis, StridedSlice(Some(1), Some(3), 1)]); // shape [2, 3, 2]
443
- /// t.index(&[Index(-1)]); // shape [3, 4]
444
- /// t.index(&[Full, StridedSlice(Some(1), None, 1), Index(1)]); // shape [2, 2]
442
+ /// t.index(&[nr:: Ellipsis, nr:: StridedSlice(Some(1), Some(3), 1)]); // shape [2, 3, 2]
443
+ /// t.index(&[nr:: Index(-1)]); // shape [3, 4]
444
+ /// t.index(&[nr:: Full, nr:: StridedSlice(Some(1), None, 1), nr:: Index(1)]); // shape [2, 2]
445
445
/// ```
446
446
pub fn index ( & self , selection : & [ AxisIndex ] ) -> Tensor < T > {
447
447
let ( sel, mut newaxes) = self . expand_indices ( selection) ;
@@ -789,9 +789,9 @@ impl<T: Copy + Add + Zero + One> Tensor<T> {
789
789
/// Creates a new vector with integer values starting at 0 and counting up:
790
790
///
791
791
/// ```
792
- /// use numeric::DoubleTensor ;
792
+ /// use numeric as nr ;
793
793
///
794
- /// let t = DoubleTensor ::range(5); // [ 0.00 1.00 2.00 3.00 4.00]
794
+ /// let t: nr::Tensor<f64> = nr::Tensor ::range(5); // [ 0.00 1.00 2.00 3.00 4.00]
795
795
/// ```
796
796
pub fn range ( size : usize ) -> Tensor < T > {
797
797
let mut data = Vec :: with_capacity ( size) ;
0 commit comments