I think the creation of the mask should not happen in the fit_tensor function. The mask creation should be always before fit_tensor as it is done in FSL and mrtrix etc. I mean that the mask should always be provided even if it is ones everywhere.