Added choose function in tensor/var.py