Caffe2 - Python API
A deep learning, cross platform ML framework
variable.py
1 import torch
2 from torch._six import with_metaclass
3 
4 
5 class VariableMeta(type):
6  def __instancecheck__(self, other):
7  return isinstance(other, torch.Tensor)
8 
9 
10 class Variable(with_metaclass(VariableMeta, torch._C._LegacyVariableBase)):
11  pass
12 
13 
14 from torch._C import _ImperativeEngine as ImperativeEngine
15 Variable._execution_engine = ImperativeEngine()