public static void applyMask(INDArray to, INDArray mask) {
        //Two possibilities exist: it's *per example* masking, or it's *per output* masking
        //These cases have different mask shapes. Per example: column vector. Per output: same shape as score array
        if (mask.isColumnVectorOrScalar()) {
            to.muliColumnVector(mask.castTo(to.dataType()));
        } else if (Arrays.equals(to.shape(), mask.shape())) {
            to.muli(mask.castTo(to.dataType()));
        } else {
            throw new IllegalStateException("Invalid mask array: per-example masking should be a column vector, "
                            + "per output masking arrays should be the same shape as the labels array. Mask shape: "
                            + Arrays.toString(mask.shape()) + ", output shape: " + Arrays.toString(to.shape()));
        }
    }
public static void applyMask ( INDArray to , INDArray mask ) { if ( mask . isColumnVectorOrScalar ( ) ) { to . muliColumnVector ( mask . castTo ( to . dataType ( ) ) ) ; } else if ( Arrays . equals ( to . shape ( ) , mask . shape ( ) ) ) { to . muli ( mask . castTo ( to . dataType ( ) ) ) ; } else { throw new IllegalStateException ( "Invalid mask array: per-example masking should be a column vector, " + "per output masking arrays should be the same shape as the labels array. Mask shape: " + Arrays . toString ( mask . shape ( ) ) + ", output shape: " + Arrays . toString ( to . shape ( ) ) ) ; } }
@param to
@param mask