torch.fx.experimental.unification.more.unify_object
-
torch.fx.experimental.unification.more.unify_object(u, v, s)[source] -
Унифицирует два объекта Python. Унифицирует их тип и атрибуты
__dict__>>> 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}
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.fx.experimental.unification.more.unify_object.html