Marcel-Rodekamp / NSL

Nanosystem Simulation Library (NSL) implements statistical simulations for systems on the nanoscale
Other
2 stars 0 forks source link

Some uses of resize are going to be deprecated by torch. #118

Open evanberkowitz opened 1 year ago

evanberkowitz commented 1 year ago

When running ./Tests/FermionMatrix/test_fermionMatrixHubbardExp as a way to test #112 I encountered very many warnings like

[W Resize.cpp:24] Warning: An output with one or more elements was resized since it had shape [1, 16, 16], which does not match the required output shape [1, 1, 16, 16]. This behavior is deprecated, and in a future PyTorch release outputs will not be resized unless they have zero elements. You can explicitly reuse an out tensor t by resizing it, inplace, to zero elements with t.resize_(0). (function resize_output_check)

I haven't investigated this warning any further but it seems prudent to sort this out before too long.

One clue is that ./Tests/FermionMatrix/test_fermionMatrixHubbardDiag does not trigger this resize warning.