A declarative optimization framework that natively supports hard constraints as well as tensors of arbitrary order. By combining a syntax close to textbook notation with automatic solver generation, the proposed solution enables flexible and rapid prototyping for constrained tensor optimization problems.