mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127841 Approved by: https://github.com/oulgen
15 lines
391 B
Python
15 lines
391 B
Python
# mypy: allow-untyped-defs
|
|
import torch
|
|
from torch._C import _ImperativeEngine as ImperativeEngine
|
|
|
|
|
|
__all__ = ["VariableMeta", "Variable"]
|
|
|
|
|
|
class VariableMeta(type):
|
|
def __instancecheck__(cls, other):
|
|
return isinstance(other, torch.Tensor)
|
|
|
|
|
|
class Variable(torch._C._LegacyVariableBase, metaclass=VariableMeta): # type: ignore[misc]
|
|
_execution_engine = ImperativeEngine()
|