def diag(k=0)
      *shp,n = shape
      n += k.abs
      a = self.class.zeros(*shp,n,n)
      a.diagonal(k).store(self)
      a
    end
def diag(k=0)
      *shp,n = shape
      n += k.abs
      a = self.class.zeros(*shp,n,n)
      a.diagonal(k).store(self)
      a
    end
Return a matrix whose diagonal is constructed by self along the last axis.