recOrder tests surfaced the following warnings at optics.py:321, optics.py:370, and stokes.py:291
recOrder/tests/cli_tests/test_reconstruct.py::test_reconstruct
/Users/talon.chandler/waveorder/waveorder/optics.py:321: 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).
* torch.tensor(z_position_list)[:, None, None]
We can use a simple util function to convert lists to tensor. This raises a warning because it is an implicit copy and can be quite expensive depending on the size of the tensors.
recOrder
tests surfaced the following warnings atoptics.py:321
,optics.py:370
, andstokes.py:291
You can generate these warnings with a call like
The core issue seems to be that some
optics
andstokes
functions can take either a list or a tensor.@ziw-liu do you think we should make sure that only lists are passed? Or can you think of a simpler solution?
This does not seem critical.