diff options
| author | Christoph Groth <christoph.groth@cea.fr> | 2025-03-06 14:56:27 +0100 |
|---|---|---|
| committer | Christoph Groth <christoph.groth@cea.fr> | 2025-03-06 14:56:27 +0100 |
| commit | 222333ff80dd678b32f1a6d491498ccb69fa68e2 (patch) | |
| tree | 915eeaaa8567690f7314a395f808df928cefa7fe /src | |
| parent | 78ce5d2152ac27ae9561c400a49ebe5f4a79451b (diff) | |
Add indexing
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index e8f7740..a16af93 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,4 +52,10 @@ fn main() { let x = x.reshape(&[2; 7]); let x = x.permute(&[6, 5, 4, 3, 2, 1, 0]); dbg!(std::any::type_name_of_val(&x)); + + // Indexing + for i in 0..2 { + let index = [0, i, 0, 0, i, 0, 0]; + println!("{} {} {} {}", a[i], a[[i, 0]], c[&index[..2]], x[index]); + } } |
