Fix train tensor cofi. issue #11
Add test for train tensorcofi ssue #11