static sortBasedOnPerm(a, perm) {
        if (perm) {
            return perm.map((v) => a[v]);
        }
        else {
            return a.slice().reverse();
        }
    }
/**
     * Sorts a given array based on the indices in the Perm array
     * Used in Transpose
     * @param a Array to be sorted such as dims or strides
     * @param perm Perm given; if null a will be reversed
     */
Sorts a given array based on the indices in the Perm array
Used in Transpose
@param a Array to be sorted such as dims or strides
@param perm Perm given; if null a will be reversed
Sorts a given array based on the indices in the Perm array Used in Transpose @param a Array to be sorted such as dims or strides @param perm Perm given ; if null a will be reversed
static sortBasedOnPerm(a, perm) {
        if (perm) {
            return perm.map((v) => a[v]);
        }
        else {
            return a.slice().reverse();
        }
    }
static sortBasedOnPerm ( a , perm ) { if ( perm ) { return perm . map ( ( v ) => a [ v ] ) ; } else { return a . slice ( ) . reverse ( ) ; } }
Sorts a given array based on the indices in the Perm array
 Used in Transpose
 @param a Array to be sorted such as dims or strides
 @param perm Perm given; if null a will be reversed
Sorts a given array based on the indices in the Perm array Used in Transpose @param a Array to be sorted such as dims or strides @param perm Perm given ; if null a will be reversed