An iterative algorithm for approximating the sign function of tensors with the einstein product