Skip to content

Commit eeb4e12

Browse files
committed
compare coord length if no values
1 parent c2c46a7 commit eeb4e12

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pymc/sampling/forward.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,17 @@ def sample_posterior_predictive(
795795
constant_coords = set()
796796
for dim, coord in trace_coords.items():
797797
current_coord = model.coords.get(dim, None)
798+
current_length = model.dim_lengths.get(dim, None)
799+
if hasattr(current_length, 'eval'):
800+
current_length = current_length.eval()
798801
if (
799802
current_coord is not None
800803
and len(coord) == len(current_coord)
801804
and np.all(coord == current_coord)
805+
) or (
806+
# Coord was defined without values (only length)
807+
current_coord is None
808+
and len(coord) == current_length
802809
):
803810
constant_coords.add(dim)
804811

0 commit comments

Comments
 (0)