You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
364 B
15 lines
364 B
5 months ago
|
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()
|