Skip to content

Commit 5da32ed

Browse files
committed
Add comment to set_data condition where the length comes from a shape[i] graph
1 parent 70b0c49 commit 5da32ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pymc/model.py

+6
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,12 @@ def set_data(
12061206
)
12071207
elif length_tensor.owner is not None:
12081208
# The dimension was created from a model variable.
1209+
# Get a handle on the tensor from which this dimension length was
1210+
# obtained by doing subindexing on the shape as in `.shape[i]`.
1211+
# Needed to check if it was another shared variable.
1212+
# TODO: Consider checking the graph is what we are assuming it is
1213+
# isinstance(length_tensor.owner.op, Subtensor)
1214+
# isinstance(length_tensor.owner.inputs[0].owner.op, Shape)
12091215
length_belongs_to = length_tensor.owner.inputs[0].owner.inputs[0]
12101216
if length_belongs_to is shared_object:
12111217
# No surprise it's changing.

0 commit comments

Comments
 (0)