docstr: :param callable fn: A function that inputs an arg ``y`` and outputs a
      value ``x`` such that ``y=self(x)``.
docstr_tok: [":","param","callable","fn",":","A","function","that","inputs","an","arg","``","y","``","and","outputs","a","value","``","x","``","such","that","``","y=self","(","x",")","``","."]
code: def set_inv(self, fn):
      """
      :param callable fn: A function that inputs an arg ``y`` and outputs a
          value ``x`` such that ``y=self(x)``.
      """
      assert callable(fn)
      self.inv = fn
      return fn
  
imports: import contextlib
  import functools
  import inspect
  import weakref
  from collections import OrderedDict
  from funsor.registry import PartialDispatcher
  from funsor.util import methodof
label_desc: Use image node_id 1 for calling the TransformOp obj's underlying member method code with example usage: obj.set_inv(fn) and returns: fn