private void verifyType(CompoundName name, Object value, TensorType expectedType) {
        if (value instanceof Tensor) {
            TensorType valueType = ((Tensor)value).type();
            if ( ! valueType.isAssignableTo(expectedType))
                throwIllegalInput(name, value, expectedType);
        }
        else if (expectedType.rank() > 0) { // rank 0 tensor may also be represented as a scalar or string
            throwIllegalInput(name, value, expectedType);
        }
    }
Verifies and converts properties according to any input declarations in the rank profile set on the query.

@author bratseth
container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java