<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_forward(cls, fmodel, **kwargs):
 """Construst an inverse model from a forward model and constraints. """

        im = cls(fmodel.dim_x, fmodel.dim_y, **kwargs)
        im.fmodel = fmodel
        return im