Get the first non-zero dimension
| 25 | |
| 26 | /// Get the first non-zero dimension |
| 27 | static inline dim_t getFNSD(const int dim, af::dim4 dims) { |
| 28 | if (dim >= 0) return dim; |
| 29 | |
| 30 | dim_t fNSD = 0; |
| 31 | for (dim_t i = 0; i < 4; ++i) { |
| 32 | if (dims[i] > 1) { |
| 33 | fNSD = i; |
| 34 | break; |
| 35 | } |
| 36 | } |
| 37 | return fNSD; |
| 38 | } |
| 39 | |
| 40 | namespace { |
| 41 | // casts from one type to another. Needed for af_half conversions specialization |
no outgoing calls
no test coverage detected