mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Remove the Python 2 and 3 compatibility library [six](https://pypi.org/project/six) and [future](https://pypi.org/project/future) and `torch._six`. We only support Python 3.8+ now. It's time to retire them. Pull Request resolved: https://github.com/pytorch/pytorch/pull/94709 Approved by: https://github.com/malfet, https://github.com/Skylion007
15 lines
364 B
Python
15 lines
364 B
Python
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()
|