ValueError: Not enough dimensions on Elemwise{mul,no_inplace}.0 to reduce on axis -1

It cannot work with n dimension input - it’s for 1d only.