Open grtlr opened 4 years ago
Looking at the Pytorch implementation of torch.nn.functional.dropout2d
(which is used by torch.nn.Dropout2d
), we should be able to just call tch::Tensor::feature_dropout
without generating the bindings.
Indeed there doesn't seem to be anything specific for this in the C++ api that tch-rs binds to. The feature_dropout
is properly generated and hopefully should do the trick.
If you think it would be convenient to have some dropout2d
/dropout3d
functions in the nn
module so that it's easier to discover these, this should be straightforward (maybe dropout
should also be added there in this case).
I'll work with feature_dropout
a bit.
If you think it would be convenient to have some dropout2d/dropout3d functions in the nn module so that it's easier to discover these, this should be straightforward (maybe dropout should also be added there in this case).
Once, I'm confident that it works as expected I will open a PR.
@LaurentMazare Could we get binding generation process documented? Even though we have a Makefile
at the root, it requires OCaml toolchain. Potential contributors may not have knowledge about it.
It seems like no bindings are created for
Tensor::dropout2d
(or higher dimensions). I'm probably missing something, but is there a way to currently achieve this intch-rs
? Or, would it be possible to generate these bindings? Also, do you think it would make sense to generate dropout modules intch::nn
, similar to the Python API?I've found #136, is the process described there still up-to-date? If the process does not involve too much knowledge of OCaml, I could also try adding these bindings, maybe with a little bit of help from your side.
Regardless, I wanted to thank you again for creating this crate. It continues to be of tremendous value to me and my research.