I have a Constant
that I would like to modify during execution. It works when it's scalar:
c = Constant(0.0)
c.assign(1.0)
But not so well when it's a vector:
v = Constant((0.0, 0.0))
v.assign((1.0, 0.0))
# or v.assign([1.0, 0.0]) or even v.assign(np.array([1.0, 0.0]))
# TypeError: in method 'Constant_assign', argument 2 of type 'double'
Edit: looking at Constant.h, it looks like it should be possible by using multiple arguments as in v.assign(1.0, 0.0)
but this fails with NotImplementedError: Wrong number or type of arguments for overloaded function 'Constant_assign'
.
Is there a way to do it ?