Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in Truncated with Deterministic inputs #7315

Merged
merged 1 commit into from
May 16, 2024

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented May 14, 2024

When using Deterministic, variables get wrapped in an identity operation. When attempting to define an icdf, the logp graph rewrites would remove this useless operation from the graph of the underlying RV and cause a mismatch between explict and implicit inputs of the inner graph of TruncatedRV

Description

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7315.org.readthedocs.build/en/7315/

When using `Deterministic`, variables get wrapped in an `identity` operation. When attempting to define an `icdf`, the logp graph rewrites would remove this useless operation from the graph of the underlying RV and cause a mismatch between explict and implicit inputs of the inner graph of TruncatedRV
@ricardoV94
Copy link
Member Author

CC @tomicapretto

@jessegrabowski
Copy link
Member

What's the point of wrapping Deterministics with a useless identity Op?

@ricardoV94
Copy link
Member Author

ricardoV94 commented May 14, 2024

What's the point of wrapping Deterministics with a useless identity Op?

So they are different PyTensor variables, when you do pm.Deterministic("y", pm.Normal("x")) or repeated Deterministic on the same variables

@ricardoV94
Copy link
Member Author

The copy was added in #3170

Copy link
Contributor

@tomicapretto tomicapretto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed fixes the example I shared in the issue (thanks!!) but I'm testing another Hurdle* likelihood, HurdleNegativeBinomial, and I see another kind of issue.

import pymc as pm
import pytensor.tensor as pt

y = pm.draw(pm.HurdleNegativeBinomial.dist(psi=0.7, mu=5, alpha=2), 100)

with pm.Model() as model:
    a = pm.Normal("Intercept", mu=0, sigma=1)
    mu = pm.Deterministic("mu", pt.exp(a))
    alpha = pm.Deterministic("alpha", pt.exp(pm.Normal("log_alpha")))
    psi = pm.Beta("psi", alpha=2, beta=2)
    pm.HurdleNegativeBinomial("y", mu=mu, alpha=alpha, psi=psi, observed=y)
    pm.sample(tune=100, draws=100)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> Cannot convert Type Vector(bool, shape=(100,)) (of Variable Alloc.0) into Type Vector(int32, shape=(100,)). You can try to manually convert Alloc.0 into a Vector(int32, shape=(100,)). local_inline_composite_constants
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_inline_composite_constants
ERROR (pytensor.graph.rewriting.basic): node: Composite{...}(Composite{or(or(lt(i1, 0), gt(i1, 1)), lt(i0, 0))}.0, [False Fal ... lse False], Composite{...}.8, Composite{...}.4, [0], [200])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 483, in replace
    new_var = var.type.filter_variable(new_var, allow_convert=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/type.py", line 278, in filter_variable
    raise TypeError(
TypeError: Cannot convert Type Vector(bool, shape=(100,)) (of Variable Alloc.0) into Type Vector(int32, shape=(100,)). You can try to manually convert Alloc.0 into a Vector(int32, shape=(100,)).

Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Betainc_grad(Switch.0, [0.], [1.], [1.], [0.], [1.], [0.], [0.], [0.], [0.], [1], Second.0, [1. 1. 1. ... 1. 1. 1.], ExpandDims{axis=0}.0, Exp.0, Sub.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 345, in local_fill_sink
    model.type.dtype != c.type.dtype
                        ^^^^^^
AttributeError: 'list' object has no attribute 'type'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: True_div(ExpandDims{axis=0}.0, Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Psi(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_fill_sink
ERROR (pytensor.graph.rewriting.basic): node: Gammaln(Second.0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 368, in local_fill_sink
    r = local_fill_sink.transform(fgraph, new_client.owner)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 365, in local_fill_sink
    fgraph.clients[new_client.owner.outputs[0]] = fgraph.clients[
                   ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'owner'

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))). local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_useless_elemwise
ERROR (pytensor.graph.rewriting.basic): node: Or(Or.0, [False Fal ... lse False])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 512, in replace
    self.change_node_input(
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 432, in change_node_input
    raise TypeError(
TypeError: The type of the replacement (Vector(bool, shape=(1,))) must be compatible with the type of the original Variable (Vector(bool, shape=(100,))).

/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <class 'TypeError'> Cannot convert Type Vector(bool, shape=(100,)) (of Variable Alloc.0) into Type Vector(int32, shape=(100,)). You can try to manually convert Alloc.0 into a Vector(int32, shape=(100,)). local_inline_composite_constants
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: local_inline_composite_constants
ERROR (pytensor.graph.rewriting.basic): node: Composite{...}(Composite{or(or(lt(i1, 0), gt(i1, 1)), lt(i0, 0))}.0, [False Fal ... lse False], Composite{...}.8, Composite{...}.4, [0], [200])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1965, in process_node
    fgraph.replace_all_validate_remove(  # type: ignore
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 628, in replace_all_validate_remove
    chk = fgraph.replace_all_validate(replacements, reason=reason, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/features.py", line 573, in replace_all_validate
    fgraph.replace(r, new_r, reason=reason, verbose=False, **kwargs)
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/graph/fg.py", line 483, in replace
    new_var = var.type.filter_variable(new_var, allow_convert=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/type.py", line 278, in filter_variable
    raise TypeError(
TypeError: Cannot convert Type Vector(bool, shape=(100,)) (of Variable Alloc.0) into Type Vector(int32, shape=(100,)). You can try to manually convert Alloc.0 into a Vector(int32, shape=(100,)).

/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
/home/tomas/anaconda3/envs/pymc-dev/lib/python3.11/site-packages/pytensor/tensor/rewriting/elemwise.py:702: UserWarning: Optimization Warning: The Op betainc does not provide a C implementation. As well as being potentially slow, this also disables loop fusion.
  warn(
Multiprocess sampling (2 chains in 2 jobs)
NUTS: [Intercept, log_alpha, psi]

I still manages to sample, but I don't know if it'll work in other cases (and it's not a nice user experience)

@ricardoV94
Copy link
Member Author

Looks like a PyTensor rewrite bug, it thinks it has a variable but it has a list, and it's trying to call .dtype on it

@ricardoV94
Copy link
Member Author

@tomicapretto the issue you reported is independent of these changes, and should be fixed by pymc-devs/pytensor#773

I'm going to go ahead and merge this

@ricardoV94 ricardoV94 merged commit 3888d53 into pymc-devs:main May 16, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants