@Override
    public int hashCode() { return Objects.hash("diag", type, diagFunction); }
A tensor generator which returns a tensor of any dimension filled with 1 in the diagonal and 0 elsewhere.

@author bratseth
vespajlib/src/main/java/com/yahoo/tensor/functions/Diag.java