symforce
symforce copied to clipboard
matrix.py operations not returning <class 'symforce.geo.matrix'> types
I noticed that if I wanted to do jacobian after playing around with some matrix math, the output is a <class 'symengine.lib.symengine_wrapper.Add'> and not something like <class 'symforce.geo.matrix.Matrix31'>. To reproduce:
v1 = v.T*v
v2 = v.squared_norm()
dv1 = v1.jacobian(v)
dv2 = v2.jacobian(v)
dv2 will throw an error. Is this by design?
v.squared_norm() will return a scalar type, so it has .diff() defined instead of .jacobian(). To make a vector, you can call geo.V1(v2). Does that help?