Spec-Zone.ru › PyTorch 2.14

torch.fx.experimental.unification.variable.variables

torch.fx.experimental.unification.variable.variables(*variables) [исходный код]

Менеджер контекста для логических переменных

Пример

>>> from __future__ import with_statement
>>> with variables(1):
...     print(isvar(1))
True
>>> print(isvar(1))
False
>>> # Normal approach
>>> from unification import unify
>>> x = var("x")
>>> unify(x, 1)
{~x: 1}
>>> # Context Manager approach
>>> with variables("x"):
...     print(unify("x", 1))
{'x': 1}
Тип возвращаемого значения:

Generator[None, None, None]

© 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.variable.variables.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API