Refactored tensor opt to remove all use of the problematic decorator shortcut.