When I try to create an numpy array with more than 32 dimensions I get an error:
import numpy as np
np.ndarray([1] * 33)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-78103e601d91> in <module>()
----> 1 np.ndarray([1] * 33)
ValueError: sequence too large; cannot be greater than 32
I found this: Using numpy.array with large number of dimensions to be related to this question but I want to do this without building my own version.
My use case:
I am working with Joint Probability Distributions and I am trying to represent each variable on an axis so that computations on it (marginalize, reduce) is a single line operation. For example for a marginalize operation I can simply do a sum over the axis of that variable. For multiplication I can simply do a simple numpy multiplication (after checking if the axes are the same).
Is there a possible workaround this?