C++ DCGAN Tutorial, 'transposed' error


Compiling the DCGAN tutorial code: https://pytorch.org/tutorials/advanced/cpp_frontend.html, I receive this error:

.../pytorch/examples/cpp/dcgan/dcgan.cpp:48:23: error: ‘struct torch::nn::ConvOptions<2>’ has no member named ‘transposed’ 48 | .transposed(true)), |

Any idea how to handle this?

If you are using 1.4.0, you would have to change the code to torch:nn:ConvTranspose{1,2,3}d.
From the release notes:

If users have transposed originally set to true in torch::nn::Conv{1,2,3}dOptions , they should migrate their code to use torch::nn::ConvTranspose{1,2,3}d layers instead.

The tutorial should be updated.
CC @yf225 Do you know, whom to ping?

1 Like

I just updated https://pytorch.org/tutorials/advanced/cpp_frontend.html and the accompanying example code to fix the error. Please feel free to try it again :smiley: