check_aligned_shape#

pymc_marketing.pytensor_utils.check_aligned_shape(name, shape, layout)[source]#

Raise if the non-sample shape differs from the constructed one.

Parameters:
  • name (str) – The posterior variable, named in the error.

  • shape (tuple[int, ...]) – Its non-sample shape, in the layout’s dim order.

  • layout (VariableLayout) – The layout the variable was constructed with.

Raises:

ValueError – If shape differs from layout.shape. Only the sample dimension may change length.