It seems you’ve posted an older code, as it’s currently not executable, e.g. self.eps is defined outside of a method, you are using type=affine which is also undefined. Could you post the current code again?