mattloper / chumpy

MIT License
196 stars 120 forks source link

can't assign a Ch objects as a subset of another #11

Closed aeoleader closed 5 years ago

aeoleader commented 7 years ago

I am trying to assign a 3x3 array as a subset of a 3x3x9 array, but it gives me Exception: Can't assign a Ch objects as a subset of another. The following code is troublesome: k = ch.arange(81).reshape(3, 3, 9) tmp = ch.eye(3) k[:, :, 1] = tmp The complete error message is the following: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/chumpy/ch.py", line 468, in setitem raise Exception("Can't assign a Ch objects as a subset of another." Exception: Can't assign a Ch objects as a subset of another.

thmoa commented 7 years ago

As the error says, you cannot assign Ch objects to others. You can either assign a numpy array to k or stack 9 Ch objects.