fixed issue with Pi tensor sometimes returning NaN
Merge branch 'master' of github.com:dylan-jayatilaka/tonto