Does tensor.to(device) copy the data if the data is already present in GPU?

I’m working with libtorch and I’ve input data which is already present in GPU(cuda). I’m making a tensor from my data this way,

torch::Tensor input_tensor = torch::from_blob(input_image.data,{1,engine_input_rows,engine_input_cols,engine_input_channels});

If I don’t use input.to(‘cuda’) the system thinks that input tensor is in CPU. So if I do input.to(‘cuda:0’) does libtroch know that the data is already present in GPU and not cause me any transfer computation?