static incrementIndex(index, dims, axisToIncrementOn) {
        if (dims.length === 0 || index.length === 0) {
            throw new Error('Index incrementing unsupported for scalar Tensor');
        }
        if (axisToIncrementOn === undefined) {
            axisToIncrementOn = dims.length;
        }
        else {
            if (axisToIncrementOn <= 0 || axisToIncrementOn > dims.length) {
                throw new Error('Incorrect axis to increment on');
            }
        }
        for (let k = axisToIncrementOn - 1; k >= 0; --k) {
            index[k]++;
            if (index[k] < dims[k]) {
                break;
            }
            index[k] = 0;
        }
    }
/**
     * Increment an index into a tensor (in lexicographic ordering), wrapping around the specified upper_bound.
     * @param index Given index to increment (Will be mutated)
     * @param dims The dimensions of the tensor for which the given index corresponds to
     * @param axisToIncrementOn The 1-indexed axis to increment on. If undefined, axisToIncrementOn == rank
     */
Increment an index into a tensor (in lexicographic ordering), wrapping around the specified upper_bound.
@param index Given index to increment (Will be mutated)
@param dims The dimensions of the tensor for which the given index corresponds to
@param axisToIncrementOn The 1-indexed axis to increment on. If undefined, axisToIncrementOn == rank
Increment an index into a tensor ( in lexicographic ordering ) wrapping around the specified upper_bound . @param index Given index to increment ( Will be mutated ) @param dims The dimensions of the tensor for which the given index corresponds to @param axisToIncrementOn The 1 - indexed axis to increment on . If undefined axisToIncrementOn == rank
static incrementIndex(index, dims, axisToIncrementOn) {
        if (dims.length === 0 || index.length === 0) {
            throw new Error('Index incrementing unsupported for scalar Tensor');
        }
        if (axisToIncrementOn === undefined) {
            axisToIncrementOn = dims.length;
        }
        else {
            if (axisToIncrementOn <= 0 || axisToIncrementOn > dims.length) {
                throw new Error('Incorrect axis to increment on');
            }
        }
        for (let k = axisToIncrementOn - 1; k >= 0; --k) {
            index[k]++;
            if (index[k] < dims[k]) {
                break;
            }
            index[k] = 0;
        }
    }
static incrementIndex ( index , dims , axisToIncrementOn ) { if ( dims . length === 0 || index . length === 0 ) { throw new Error ( 'Index incrementing unsupported for scalar Tensor' ) ; } if ( axisToIncrementOn === undefined ) { axisToIncrementOn = dims . length ; } else { if ( axisToIncrementOn <= 0 || axisToIncrementOn > dims . length ) { throw new Error ( 'Incorrect axis to increment on' ) ; } } for ( let k = axisToIncrementOn - 1 ; k >= 0 ; -- k ) { index [ k ] ++ ; if ( index [ k ] < dims [ k ] ) { break ; } index [ k ] = 0 ; } }
Increment an index into a tensor (in lexicographic ordering), wrapping around the specified upper_bound.
Increment an index into a tensor ( in lexicographic ordering ) wrapping around the specified upper_bound .