Added unit tests for CoFi gradients