3 #include <torch/csrc/utils/variadic.h> 4 #include <torch/nn/cloneable.h> 5 #include <torch/nn/pimpl.h> 6 #include <torch/types.h> 7 #include <torch/csrc/WindowsTorchApiMacro.h> 60 using Function = std::function<Tensor(Tensor)>;
63 explicit FunctionalImpl(Function
function);
66 typename SomeFunction,
68 typename = torch::enable_if_t<(
sizeof...(Args) > 0)>>
69 explicit FunctionalImpl(SomeFunction original_function, Args&&... args)
70 : function_(
std::bind(
72 std::placeholders::_1,
73 std::forward<Args>(args)...)) {
80 void reset()
override;
83 void pretty_print(std::ostream& stream)
const override;
99 TORCH_MODULE(Functional);
The clone() method in the base Module class does not have knowledge of the concrete runtime type of i...