how to convert a tensor to a numpy array