You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with pymc3 (3.11.2) and theano (1.1.2) I found that dimension expansion of theano tensors shows some unexpected behaviour, compared to numpy style advanced indexing.
This code works:
import theano.tensor as T
A = T.zeros((3,4))
B = A[None,:,:]
While leaving out the last axis indexer raises a ValueError:
import theano.tensor as T
A = T.zeros((3,4))
B = A[None,:]
ValueError: ('You cannot drop a non-broadcastable dimension.', ([False, False], ['x', 0]))
In numpy you can usually leave out trailing ",:" axis indexers. In theano it seems they are necessary so the dimshuffle functions works correctly.
I don't know if this is fixed in any new version or if it is necessary to fix it at all. I just want to drop this somewhere on the internet for other people to find it, because that error annoyed me for a long time.
The text was updated successfully, but these errors were encountered:
When working with pymc3 (3.11.2) and theano (1.1.2) I found that dimension expansion of theano tensors shows some unexpected behaviour, compared to numpy style advanced indexing.
This code works:
While leaving out the last axis indexer raises a ValueError:
In numpy you can usually leave out trailing ",:" axis indexers. In theano it seems they are necessary so the dimshuffle functions works correctly.
I don't know if this is fixed in any new version or if it is necessary to fix it at all. I just want to drop this somewhere on the internet for other people to find it, because that error annoyed me for a long time.
The text was updated successfully, but these errors were encountered: