Why not doing 
```
return np.average(np.abs(y_pred - y_true).mean(axis=1), weights=sample_weight)
```
?