Template Function torch::init()¶
Defined in File custom_class.h
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 anint
and astd::string
as argument.