MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / get_rows

Function get_rows

src/core/index.rs:851–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

849
850 #[test]
851 fn get_rows() {
852 set_device(0);
853 // ANCHOR: get_rows
854 let a = randu::<f32>(dim4!(5, 5));
855 // [5 5 1 1]
856 // 0.6010 0.5497 0.1583 0.3636 0.6755
857 // 0.0278 0.2864 0.3712 0.4165 0.6105
858 // 0.9806 0.3410 0.3543 0.5814 0.5232
859 // 0.2126 0.7509 0.6450 0.8962 0.5567
860 // 0.0655 0.4105 0.9675 0.3712 0.7896
861 let _r = rows(&a, -1, -2);
862 // [2 5 1 1]
863 // 0.2126 0.7509 0.6450 0.8962 0.5567
864 // 0.0655 0.4105 0.9675 0.3712 0.7896
865 let _c = cols(&a, -1, -3);
866 // [5 3 1 1]
867 // 0.1583 0.3636 0.6755
868 // 0.3712 0.4165 0.6105
869 // 0.3543 0.5814 0.5232
870 // 0.6450 0.8962 0.5567
871 // 0.9675 0.3712 0.7896
872 // ANCHOR_END: get_rows
873 }
874}

Callers

nothing calls this directly

Calls 3

set_deviceFunction · 0.85
rowsFunction · 0.85
colsFunction · 0.85

Tested by

no test coverage detected