mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-02 14:45:15 +02:00
fix: uniform prior instantiation
This commit is contained in:
parent
5a0dc22426
commit
8826ebeb8d
1 changed files with 5 additions and 1 deletions
|
|
@ -100,7 +100,11 @@ class Uniform(Prior):
|
||||||
for instance in cls._instances:
|
for instance in cls._instances:
|
||||||
if instance().lower == lower and instance().upper == upper:
|
if instance().lower == lower and instance().upper == upper:
|
||||||
return instance()
|
return instance()
|
||||||
o = super(Prior, cls).__new__(cls, lower, upper)
|
newfunc = super(Prior, cls).__new__
|
||||||
|
if newfunc is object.__new__:
|
||||||
|
o = newfunc(cls)
|
||||||
|
else:
|
||||||
|
o = newfunc(cls, lower, upper)
|
||||||
cls._instances.append(weakref.ref(o))
|
cls._instances.append(weakref.ref(o))
|
||||||
return cls._instances[-1]()
|
return cls._instances[-1]()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue