blob: 57b210e7fe5d2dbc611ce5499dce5022ba65e8c0 [file] [log] [blame]
import torch
from torch._six import with_metaclass
__all__ = ["VariableMeta", "Variable"]
class VariableMeta(type):
def __instancecheck__(cls, other):
return isinstance(other, torch.Tensor)
# mypy doesn't understand torch._six.with_metaclass
class Variable(with_metaclass(VariableMeta, torch._C._LegacyVariableBase)): # type: ignore[misc]
pass
from torch._C import _ImperativeEngine as ImperativeEngine
Variable._execution_engine = ImperativeEngine()