diff --git a/botorch/optim/utils/numpy_utils.py b/botorch/optim/utils/numpy_utils.py index bc8fadfe35..ee4791b3e4 100644 --- a/botorch/optim/utils/numpy_utils.py +++ b/botorch/optim/utils/numpy_utils.py @@ -126,9 +126,7 @@ def set_tensors_from_ndarray_1d( vals = array[index : index + size] if tnsr.ndim else array[index] tnsr.copy_( torch.as_tensor(vals, device=tnsr.device, dtype=tnsr.dtype) - .to(tnsr) .view(tnsr.shape) - .to(tnsr) ) index += size except Exception as e: