Skip to content

Commit

Permalink
Patch for case when Y is a TensorVariable (#206)
Browse files Browse the repository at this point in the history
* add case tensor var for Y

* Improve `isinstance` statement

Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>

---------

Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
  • Loading branch information
AlexAndorra and aloctavodia authored Dec 19, 2024
1 parent d4e8cad commit 77116d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymc_bart/bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from pymc.logprob.abstract import _logprob
from pytensor.tensor.random.op import RandomVariable
from pytensor.tensor.sharedvar import TensorSharedVariable
from pytensor.tensor.variable import TensorVariable

from .split_rules import SplitRule
from .tree import Tree
Expand Down Expand Up @@ -54,7 +55,7 @@ def rng_fn( # pylint: disable=W0237
if not size:
size = None

if isinstance(cls.Y, TensorSharedVariable):
if isinstance(cls.Y, (TensorSharedVariable, TensorVariable)):
Y = cls.Y.eval()
else:
Y = cls.Y
Expand Down

0 comments on commit 77116d1

Please sign in to comment.