This below two code does the same thing. You can either explicitly provide the datatype or use that type of tensor.
float_tensor = torch.tensor([4,5,6], dtype=torch.float)
float_tensor = torch.FloatTensor([4,5,6])