Yeah, the research code base that I’m working on is larger and it is hard to extract a single example. The minimal example tried to capture my understanding of what might have been wrong. I discovered a few bugs in my code related to dimensions. It was a combination of bugs that led to that issue. One of the most striking ones was using sum along an axis followed by repeat; I forgot to account for the fact that the axis summed over disappears. Most errors were in parts of the code that I wrote some reasonable amount of time ago and didn’t think much of. I figured things out with a combination of line debugging and print statements. The first error message that I go was definitely opaque. Thanks for all the help.