minor fix in tensor.py