For any real number t, let \(\lfloor t\rfloor \) be the largest integer not exceeding y. As usual, let d(n) be the divisor function. Recently, Ma and Sun obtain the following \(\begin{aligned}\sum _{n\le x}d\left( \left\lfloor \frac{x}{n}\right\rfloor \right) =\lambda x+O_{\varepsilon }\left( x^{11/23+\varepsilon }\right) .\end{aligned}\) where \(\lambda =\sum _{k=1}^{\infty }\frac{d(k)}{k(k+1)}\) is an absolute constant and \(\varepsilon \) is an arbitrarily small positive number. In this article, we give a slight generalization of their formula. Specifically, we prove that for any \(c>0\) , the asymptotic formula \(\begin{aligned}\sum _{n\le x^{1/c}}d\left( \left\lfloor \frac{x}{n^{c}}\right\rfloor \right) =d_{c}x^{1/c}+O_{\varepsilon ,c}\left( x^{\theta _{c}+\varepsilon }\right) \end{aligned}\) holds, where \(\theta _{c}<\frac{1}{c}\) and \(d_{c}=\sum _{k\ge 1}d(k)\left( \frac{1}{k^{1/c}}-\frac{1}{(k+1)^{1/c}}\right) \) is a constant.