Assuming your library uses numpy for the uint16 images, use astype:
arr = np.random.randint(0, 65000, (100,), dtype=np.uint16)
arr = arr.astype(np.float32)

then create the tensor via torch.from_numpy.