mattloper/chumpy

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

Closed this issue · 1 comments

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

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.