/Users/petercotton/virtual-envs/tuneup/lib/python3.7/site-packages/ax/modelbridge/torch.py:311: UserWarning:
To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
Reproduce:
https://github.com/microprediction/tuneup/blob/master/tests/test_ax.py
Hmm, I can take a deeper look into this, but at first glance this warning actually seems a bit faulty. This line constructs from a numpy array, not copy construction from a tensor. In any case, this behavior should be safe.
@sdsingh are we sure this is a np array? Or are we believing the typing too much here? Seems quite plausible that this may be called on a Tensor / Tensoray somewhere.
Hmm, that's plausible. Given that this is the NumpyModelBridge, we really shouldn't make this call on Tensor. I'll take a deeper look.
@Balandat, you're correct, in prediction the numpy array (observation features) is actually transformed twice. Hopefully it's an easy fix, looking into it.
@microprediction, I have confirmed that this warning is, indeed, just a warning, and should not affect behavior/performance.
The fix is now in the latest stable, 0.1.18.