Unverified Commit 49722589 authored by rpgoldman's avatar rpgoldman Committed by GitHub

Fix for 3727. (#3856)

parent 4a37e24d
......@@ -713,7 +713,7 @@ class ValueGradFunction:
return args_joined, theano.clone(cost, replace=replace)
class Model(Factor, WithMemoization, metaclass=ContextMeta, context_class='Model'):
class Model(Factor, WithMemoization, metaclass=ContextMeta):
"""Encapsulates the variables and likelihood factors of a model.
Model class can be used for creating class based models. To create
......@@ -855,7 +855,7 @@ class Model(Factor, WithMemoization, metaclass=ContextMeta, context_class='Model
def isroot(self):
return self.parent is None
@property # type: ignore -- mypy can't handle decorated types.
@property # type: ignore
@memoize(bound=True)
def bijection(self):
vars = inputvars(self.vars)
......@@ -1232,6 +1232,10 @@ class Model(Factor, WithMemoization, metaclass=ContextMeta, context_class='Model
__latex__ = _repr_latex_
# this is really disgusting, but it breaks a self-loop: I can't pass Model
# itself as context class init arg.
Model._context_class = Model
def set_data(new_data, model=None):
"""Sets the value of one or more data container variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment