Traktor/myenv/Lib/site-packages/torch/autograd/variable.py

15 lines
364 B
Python
Raw Permalink Normal View History

2024-05-26 05:12:46 +02:00
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()