torch.fx.experimental.unification.more.unify_object#
- torch.fx.experimental.unification.more.unify_object(u, v, s)[source]#
Unify two Python objects Unifies their type and
__dict__attributes >>> class Foo(object): … def __init__(self, a, b): … self.a = a … self.b = b … … def __str__(self): … return “Foo(%s, %s)” % (str(self.a), str(self.b)) >>> x = var(“x”) >>> f = Foo(1, x) >>> g = Foo(1, 2) >>> unify_object(f, g, {}) {~x: 2}