encode device as value in raw tensor
encode device as value in raw tensor