put as_tensor_variable
a few mistakes