Caffe2 - Python API
A deep learning, cross platform ML framework
__init__.py
1 from torch._C import _set_backcompat_broadcast_warn
2 from torch._C import _get_backcompat_broadcast_warn
3 from torch._C import _set_backcompat_keepdim_warn
4 from torch._C import _get_backcompat_keepdim_warn
5 
6 
7 class Warning(object):
8  def __init__(self, setter, getter):
9  self.setter = setter
10  self.getter = getter
11 
12  def set_enabled(self, value):
13  self.setter(value)
14 
15  def get_enabled(self):
16  return self.getter()
17 
18  enabled = property(get_enabled, set_enabled)
19 
20 broadcast_warning = Warning(_set_backcompat_broadcast_warn, _get_backcompat_broadcast_warn)
21 keepdim_warning = Warning(_set_backcompat_keepdim_warn, _get_backcompat_keepdim_warn)