Provide a non-templated Optimizer type.
The structure tch::nn::Optimizer<T> has T as a template parameter in order to store the config used to create it in a private field. As far as I can tell, this config is not used by tch and cannot be used by users since it is private. As a result of this templating, one cannot write code that takes in an arbitrary optimizer (Adam/Sgd/etc) without pointlessly templating on T. (At least without writing a wrapper around Optimizer that forwards all of its methods).
It also means that you cannot write a function like fn make_optimizer(&str) -> Option<Optimizer> to e.g. dynamically select the optimizer type from a command-line string.
I think that <T> and the associated config: T field should be dropped from tch::nn::Optimizer.
Alternatively, a backwards-compatible approach could be to implement From<Optimizer<T>> for Optimizer<()> that drops the config (maybe with an alias for Optimizer<()>).
Having COptimizer available is sufficient for my purposes in terms of a non-templated optimizer type. It might still be nice in general to have the methods of Optimizer be available without templating but feel free to close this issue if you prefer to leave Optimizer as-is.