Shortcuts

Template Function torch::init()

Function Documentation

template<class ...Types>
detail::types<void, Types...> torch::init()

This function is used in conjunction with class_::def() to register a constructor for a given C++ class type.

For example, torch::init<int, std::string>() would register a two-argument constructor taking an int and a std::string as argument.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources