You’ll need to make the initial values into tensors then with tf.constant
. All that signals.combine
does with Tensors is concatenates along the first axis, so it’s probably easiest to do that first in Numpy, and then make the big concatenated set of weights into a Tensor.
Frankly, there’s a lot of extra complexity in the NengoDL builder classes to allow multiple operators (ops
) to be merged into one operator for speed. But when you’re implementing your own operator, you often don’t care as much about speed. If you add the following to your builder class, it will make sure that operators are never merged for your builder (if you’re inheriting directly from OpBuilder
, this is the standard definition, so you don’t need to add it again):
@staticmethod
def mergeable(x, y):
return False
Then, you should be able to put assert len(ops) == 1
in __init__
and do everything just based around one operator, so you don’t have to worry about combining multiple initial values into one Tensor.