Skip to content

Commit c97a4de

Browse files
committed
change __hash__
1 parent 62cd85c commit c97a4de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pymc3/variational/opvi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class ObjectiveFunction(object):
134134
tf : :class:`TestFunction`
135135
OPVI TestFunction
136136
"""
137+
__hash__ = id
137138

138139
def __init__(self, op, tf):
139140
self.op = op
@@ -357,6 +358,7 @@ class Operator(object):
357358
-----
358359
For implementing Custom operator it is needed to define :func:`Operator.apply` method
359360
"""
361+
__hash__ = id
360362

361363
has_test_function = False
362364
returns_loss = True
@@ -449,6 +451,8 @@ def collect_shared_to_list(params):
449451

450452

451453
class TestFunction(object):
454+
__hash__ = id
455+
452456
def __init__(self):
453457
self._inited = False
454458
self.shared_params = None
@@ -671,6 +675,7 @@ class Group(object):
671675
- Kingma, D. P., & Welling, M. (2014).
672676
`Auto-Encoding Variational Bayes. stat, 1050, 1. <https://arxiv.org/abs/1312.6114>`_
673677
"""
678+
__hash__ = id
674679
# need to be defined in init
675680
shared_params = None
676681
symbolic_initial = None
@@ -1066,6 +1071,8 @@ class Approximation(object):
10661071
--------
10671072
See more info about :class:`Group` in it's docstring.
10681073
"""
1074+
__hash__ = id
1075+
10691076
def __init__(self, groups, model=None):
10701077
self._scale_cost_to_minibatch = theano.shared(np.int8(1))
10711078
model = modelcontext(model)

0 commit comments

Comments
 (0)