Allow mutable state in maybe_scalar_fun wrapper
Created by: yannra
Hi all, In general, mutable states of the models are supported by netket. If these are used, the model apply_fun will generally return a tuple where the second element contains the state indicated as mutable. The recent commit e27386c1 does however explicitly assume that only the model value is returned by the model apply_fun (which breaks if a tuple is returned). This PR fixes this by checking if the return type is a tuple or not.
Hope this makes sense.
Best, Yannic